Skip to main content

System (Class Keyword)

Influences the compilation order for this class.

Usage

To influence the compilation order for a class, use syntax like the following:

Class MyApp.Person Extends %Persistent [ System = n ]  
{ //class members }

Where n is an integer ranging from 0 to 4, where classes with the lower positive values are compiled before classes with higher positive values. Classes with values of 0 (zero) are compiled last.

Details

This keyword establishes groups of classes, each associated with a different value and priority, where the full class compilation process occurs for each priority level before moving on to the subsequent priority level. From highest priority to lowest priority, the levels are:

  • 1

  • 2

  • 3

  • 4

  • 0 (the default)

Class compilation has two steps:

  1. Resolving the globals.

  2. Compiling the routines.

All classes with the same value of the System keyword have their globals resolved before routine compilation. With classes of varying levels, those of higher priority have both resolved globals and compiled routines before those of lower priority have their globals resolved.

The CompileAfter and DependsOn keywords work within the classes with a common System value to determine the order of global resolution. Once all classes with a common System value have had their globals resolved, then routine compilation proceeds for all of them.

Hence, if class B needs to run a method of class A in class B’s method generator (that is, during compilation of B), then A must have a higher priority than B. This means that the value for A’s System keyword must be a non-zero integer that is lower than the value for B. To obtain this behavior, CompileAfter or DependsOn do not work.

Effect on Subclasses

This keyword is not inherited.

Default

The default value is 0 (zero).

See Also

FeedbackOpens in a new tab