Defining communication objects  Defining blob objects

Chapter 3: Using MSG-IDE

Defining data objects

Data objects provide data variable definitions and contain data that you may want to manipulate or access at a later point in the program. A data object is any data variable defined with MSG-IDE or TRAN-IDE.

Use the Define dialog box to build data objects to:

As you build a definition, you can see what the program generates in the viewing area at the bottom of the dialog box. Expand the size of the viewing area, if necessary, to view an entire definition

StepsDefining data objects

  1. To access the Define dialog box, select Data from the Classes list and click Add.

  2. For the Basic Datatype, complete the following fields:

    Type

    Description

    char

    Character: a single character.

    short

    Short Integer: a whole number in the range of -32767 to +32767

    int

    Integer: a whole number in the range of --2147483647 to +2147483647

    long

    Long Integer: a whole number in the range of -2147483647 to +2147483647

    float

    Floating Point: a floating point number.

    string

    A null-terminated character string.

    cptr

    A real C memory pointer.

    iptr

    For internal use only.

    void

    A void pointer

    decimal

    A decimal number, like 123.45

    blob

    A binary large object block. A collection of bytes that can include null characters, and is terminated by length.

    clNdo

    Use in conjunction with tree data, supported by the clNdo object.

    clot

    Use in conjunction with transports, supported by the clot object.

    clmap

    Store string pairs in a <key, element> format.

  3. From the Class drop-down list, select to build an object for the selected class.

    Only the classes that are useful in a message AIM are listed below. Except the string class, you can also build any of these objects directly from the Browse dialog box.

    Class

    Description

    Timer

    To build a timer object.

    Control Flow

    Builds a control flow object.

    Message Frame

    Builds a message frame object.

    Protocol

    Builds a protocol object.

    Communications

    Builds a communications object.

    string

    Builds a string object.

    Blob

    Builds a blob object

    Production

    Use TRAN-IDE to edit Production Objects. Not used by MSG-IDE

    clNdo

    Use to build an NDO object.

    clot

    Use to build a transport object.

    clmap

    Store string pairs in a <key, element> format.

  4. Click Distributed Function to define a Distributed Function Call that this program makes to an AIM or an instance of SFM.

    These are blocking function calls; that is, after the program issues this DFC command, it waits for a return response from the program that services the function call before it continues its own processing.

    To build a DFC command, type its name in the Name field and click either OK or Accept. The Distributed Function Declaration dialog box opens, where you define the DFC command arguments.

  5. Click Symbolic Name to add a local or global Symbolic Name.

    A symbolic name is a means for substituting a name for a particular value, usually a number. Symbolic names allow you to reference a number when the value of the number may change. For example, if you set up a symbolic name for the maximum number of cattle you could keep in a pen (#define MAXINPEN 10), and used the symbolic name (MAXINPEN) instead of the number (10) throughout your program, then, if the pen size changes so you can only put 5 cattle in a pen, you only have to change the symbolic name value.

    You can use a symbolic name Data Object in Custom, Callback, and Validation functions. If you set Exclusive to Domain ON, the program builds a #lcldefine statement that is available only to the objects and functions in the current module.

    If you have Exclusive to Domain set OFF, the program builds a icldefine statement that is available to all the objects and functions in the entire project. Only numeric values are supported.

  6. Click Custom to define data objects that are not available with the basic datatype option. Use the area at the bottom of the Define dialog box to enter your code.

  7. Type the user-assigned name for this definition

    In all cases, make this name unique within the domain. If you have Exclusive to Domain deselected for building a global definition, you should make the name unique to the project. Names must be a maximum of 32 characters, contain only A-Z, a-z, 0-9, and underscore characters, and begin with an alpha character.

  8. In the Initial Value field, type the initial value for the data object.

    This value is useful only when defining a basic datatype or a symbolic name.

  9. In the Array Size field, type the size of an array.

    This field is only available for definitions of basic datatypes.

  10. Do one of the following:

  11. The viewing area at the bottom of the Define dialog box displays the Data Object you are currently creating and, in some cases, allows you to edit that Data Object definition.

    If the definition is longer than two lines, either use the scrolling arrows or enlarge the viewing area. To enlarge the viewing area, move the cursor over the bottom of the dialog box until it displays as a two-way arrow. Then hold the left mouse button down, drag the cursor to the size of the dialog box you want, and release the mouse button.

  12. Do one of the following:





Copyright © 2005. Sybase Inc. All rights reserved. Defining blob objects

View this book as PDF