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:
Build a DFC command for gathering or sending data.
Add a symbolic name definition.
Build your own structures or class definitions.
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
Defining data objects
To access the Define dialog box, select Data from the Classes list and click Add.
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. |
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. |
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.
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.
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.
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.
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.
In the Array Size field, type the size of an array.
This field is only available for definitions of basic datatypes.
Do one of the following:
(Default) Select the Exclusive to Domain check box to allow the data object to be accessed only by other objects and functions within the same domain.
Deselect the Exclusive to Domain check box to allow all objects and functions in the project to reference the data object.
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.
Do one of the following:
Click OK to build the data object and return to the Browse dialog box.
Click Accept to build the data object and remain in the define dialog box.
Click Cancel to return to the Browse dialog box without building the data object.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |