Several previous code examples have already illustrated all
types of field feature definition allowed in section DEFS.
Each definition consists of at least two logical lines,
the first one specifying the index of the field referred to
by the definition, and the others specifying the actual
contents of the definition.
The following paragraphs and tables summarize the syntax for the
different field feature definitions.
A range definition may be associated with a field of type
range or to a field of type float. Conversely, a range
field must have a range definition associated with it,
while a float field may have an associated range definition.
Table 6 - Range definition syntax
Language item
|
Description
|
Example
|
index:
|
Index of the field being defined. The index must appear alone on the source line
|
a:
|
min / max
|
Minimum and maximum legal values for the field
|
18/120
|
An enumeration definition must be associated with exactly one field of type
enum. It consists of the index line followed by
one or more logical lines each containing identifiers
and labels for the enumeration values.
By default, Sisendel associates with each enumeration identifier a
numeric value, starting from 0. Alternatively,
each definition may associate a user-defined value
with the corresponding enumeration identifier.
User-defined values can be integer numbers or character constants.
Table 7 - Plain enumeration definition syntax
Language item
|
Description
|
Example
|
index:
|
Index of the field being defined. The index must appear alone on the source line
|
a:
|
identifier
|
Symbolic enumeration value identifier
|
first_class
|
label
|
Human-readable label for the enumeration value
|
"First class"
|
Table 8 - Integer enumeration definition syntax
Language item
|
Description
|
Example
|
index:
|
Index of the field being defined. The index must appear alone on the source line
|
a:
|
identifier
|
Symbolic enumeration value identifier
|
first_class
|
value
|
Decimal integer value to be associated with the identifier
|
1
|
label
|
Human-readable label for the enumeration value
|
"First class"
|
Table 9 - Character enumeration definition syntax
Language item
|
Description
|
Example
|
index:
|
Index of the field being defined. The index must appear alone on the source line
|
a:
|
identifier
|
Symbolic enumeration value identifier
|
first_class
|
value
|
Single-character value (between single quotes) to be associated with the identifier
|
'F'
|
label
|
Human-readable label for the enumeration value
|
"First class"
|
A function definition may only be associated with a field of type
function. Purpose of the function definition is to specify
the function signature, that is,
the input parameters and the return value type of the
function.
A function definition consists of the index line followed by
one or more logical lines, each containing
one signature. In most cases, a function definition
will have one signature; additional signatures
may be defined to overload the function interface.
Each function must have at least one signature
definition associated with it. Each signature consists of
a list of input parameters, followed by the
symbolic representation of an
arrow (the string "->"), followed by
the function return value type.
Function parameters and return value type
are specified by means of
field indexes: this implies that they be defined
in the entity fields list of section CORE.
A void list of function parameters is specified
by using a "0" (zero) in place of the
field indexes before the arrow "->".
In the same way, a void return
value is specified by a "0" (zero)
after the arrow "->".
Table 10 - Function definition syntax
Language item
|
Description
|
Example
|
index:
|
Index of the field being defined. The index must appear alone on the source line
|
a:
|
input parameters
|
A list of one or more field indexes, or a 0 (zero) for a void parameter list
|
c g
|
-> return value type
|
Representation of an arrow, followed by one index field or a 0 for a void return value
|
-> e
|
[Previous chapter]
[Next chapter]
[Back to top]
|