structure <name> {
<data-block>
}
Define an identifier structure (non-graphic).
<name>
The name of the structure.
None
Multiple command lines, each of the form:
{<qual>} <type> { <element>{[<num>]} { = <value> } }
where:
<qual>
If included, may be one or more of the qualifying words "static" or "heritable".
<type>
The identifier type.
<element>
The element name, unique for the structure. This is optional, see Notes below.
<num>
The array dimension if the element is an array (may be omitted from variable-length arrays).
<value>
A class value for the element. When an object of this structure class is created, its element
<element>
will be assigned the value <value>.
This will remain its value until changed by an object member assignment.
Only non-array elements can have a class value and only when <type> is one of the following:
numeric, point, string, time, window, channel, group, filter, epointer, panel, menupane, procedure/function, blob, treenode
Values for members of type filter must be single-line definitions.
Once defined, the structure <name> may be used as a command to create an object of the structure type <name>.
<element> and <num> may be omitted when <type> is another class of structure. In such cases the members of <type> are copied into the new structure and given the same element names.
The structure definition must have application scope, but occurrences of the structure can have any scope.
When structures with graphic elements are required, the commands gstructure or compound should be used.
The qualifying word "static" defines an element to be a class value with the same value for all instances of <name>. Defining elements as static can result in considerable savings of object storage.
The qualifying word "heritable" defines an element to be available to child structures. For example, if an element named "t" of a structure is declared heritable, then object.child.child.t is equivalent to object.t.
Define the structure.
structure ~admin.person_t {
string name
string address[4]
numeric tel_no
}
Create an occurrence (object) of a person.
~admin.person_t manager
Fill in some of the details.
manager.name = 'Ari van Essen' manager.tel_no = 7658787
|
Commands: |
|
|
Identifiers: |
scope (atable) |
|
Structures: |