Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
Please note: this document is currently under revision.
The information herein contained, while still valid, does not reflect the latest state of the described technology.
The Somusar/SoProTech[tm] Booklet Series
Volume III

"somusar/Sisendel: A Tutorial Introduction"

Printer friendly


Contents
1. Introduction
2. Sisendel Software Entities
3. Sisendel Basic Types
4. Sisendel User Types
5. Contents of an Entity File
6. Section CORE
7. Section DEFS
7.1 Definition of a numeric range
7.2 Definition of an enum
7.3 Definition of a function
8. Section DB
9. Section LOGIC
10. Section UI
11. Implicit Section DOC
12. Section ADJUST
13. Further Reading

Chapter 7 - Section DEFS

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.

7.1 - Definition of a numeric range        top

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

7.2 - Definition of an enum        top

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"

7.3 - Definition of a function        top

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]

http:// www.somusar.com  / doc  / booklets  / sisendel_tut  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster