Skip to main content
Version: 6.x

Static objects

Static (or built-in) objects are objects that are defined by the developer and are automatically created on system startup (if they are not present in the system at launch time). Also, such objects are prohibited from being deleted.

When declaring a custom class, you can declare objects of this class which will be static objects. If you do this, this custom class automatically inherits from class System.StaticObject.

For each static object of a custom class name and title must be specified. Later these name and title can be accessed using the properties System.staticName[System.StaticObject] and System.staticCaption[System.StaticObject] respectively.

Static objects of built-in classes are numbers, strings, date values, etc., used by the user in describing the logic.

Static objects can be used to create a limited set of objects of a certain class. Such a set can be used as an enumerated data type to provide a choice from a limited set of values.

Language

Static objects of custom classes are defined in the CLASS statement in a block enclosed in braces.

Examples

CLASS Direction 'Direction'
{
north 'North',
east 'East',
south 'South',
west 'West'
}

direction = DATA Direction ();

showDirection {
MESSAGE staticName(direction());
MESSAGE staticCaption(direction());
}

// creating a form by choosing an object of Direction class
FORM directions 'Directions'
OBJECTS d = Direction
PROPERTIES(d) READONLY staticCaption

LIST Direction OBJECT d
;