CLASS statement
CLASS statement - creating a new custom class.
Syntax
CLASS ABSTRACT name [caption] [: parent1, ..., parentN];
CLASS [NATIVE] name [caption]
[{
objectName1 [objectCaption1] [imageSetting1],
...
objectNameM [objectCaptionM] [imageSettingM]
}]
[: parent1, ..., parentN];
Description
The CLASS statement declares a new class and adds it to the current module.
The statement has two forms: CLASS ABSTRACT for declaring an abstract class and just CLASS for declaring a concrete class. In the latter case, during declaration, you can declare the static objects of this class and specify their names and captions in a curly brackets block.
The NATIVE keyword is used in some system modules. It is used to declare individual system classes that are created before the modules are initialized.
Parameters
-
nameClass name. Simple ID. The name must be unique within the current namespace.
-
captionClass caption. String literal. If the caption is not defined, the name of the class will be its caption.
-
objectName1, ..., objectNameMThe names of static objects of this class. Each name is defined by a simple ID. Name values are stored in the
System.staticNamesystem property. -
objectCaption1, ..., objectCaptionMCaptions of static objects of this class. Each caption is a string literal. If the caption is not defined, the name of the static object will be its caption. Caption values are stored in the
System.staticCaptionsystem property. -
imageSetting1, ..., imageSettingMSettings for displaying icons in the captions of static objects of this class. By default, the presence or absence of an icon is controlled by the parameters
settings.defaultImagePathRankingThresholdandsettings.defaultAutoImageRankingThreshold. TheHTMLclass value used for displaying the icon is stored in the system propertySystem.image[StaticObject]. This option allows you to manually configure the icon display. It can have one of two forms:-
IMAGE [fileExpr]Specifying the relative path to the image file that will be displayed as the icon in the caption of the static object. If
fileExpris not specified, the default icon display mode is activated.-
fileExprExpression whose value specifies the path to the image file. The path is specified relative to the
imagesdirectory.
-
-
NOIMAGEKeyword indicating that the static object's caption should have no icon.
-
-
parent1, ..., parentNList of parent class names. Each name is defined by a composite ID. If the list of parent classes is not specified, the class is inherited from the
System.Objectclass.
Examples
CLASS ABSTRACT Document; // The caption of this class will be 'Document'
CLASS IncomeDocument 'Income' : Document;
CLASS OutcomeDocument 'Expenses' : Document;
CLASS Person;
CLASS Worker;
CLASS Musician : Person, Worker; // multiple inheritance
CLASS Barcode 'Barcode'; // The parent class of Barcode will be the System.Object class
CLASS PrintOrientation {
portrait 'Portrait',
landscape 'Landscape'
}