Skip to main content
Global constants are used to specify additional search criteria (element’s Properties dialog box, Advanced tab, Advanced pre-search relations and Advanced post-search relations sections; block’s Properties dialog box, Expression field).
Global constants are set for the entire FlexiLayout and accessible in all sections of the program code. When creating a global constant, you must specify its name and value. The name of a constant must start with a letter or an underscore character, and then it can consist of letters and digits. Constant names must not contain blank spaces or special symbols. The name of a constant must be unique for the FlexiLayout in which it is to be used and cannot coincide with any of the reserved words. This means that you may not declare variables in the code whose names coincide with the names of the global constants. Constants may be of any type which has a constructor in the FlexiLayout language. The type of a constant is either defined explicitly by calling its constructor, or is derived by the program from its value (for example, type String). When you use a constant in your code, the compiler will check that this type of constant may be used in the given context. This check is performed when you build the FlexiLayout or when you ask the program to check the code in a particular field. You can create global constants using global functions and other already created global constants. Examples of global constants:

Add, change, and remove global constants

Add a global constant

1

Open the Properties dialog box

On the FlexiLayout menu, select Properties…; or right-click in the FlexiLayout window and select Properties… on the shortcut menu.
2

Open the Constants tab

In the Properties dialog box, click the Constants tab.
3

Add the constant

Click Add…, type a name and value for the constant, and then click OK.

Change a global constant

1

Open the Properties dialog box

On the FlexiLayout menu, select Properties…; or right-click in the FlexiLayout window and select Properties… on the shortcut menu.
2

Select the constant on the Constants tab

In the Properties dialog box, click the Constants tab, and then select the constant you want to change.
3

Edit the constant

Click Edit…, type a new name and value, and then click OK.

Remove a global constant

1

Open the Properties dialog box

On the FlexiLayout menu, select Properties…; or right-click in the FlexiLayout window and select Properties… on the shortcut menu.
2

Select the constant on the Constants tab

In the Properties dialog box, click the Constants tab, and then select the constant you want to remove.
3

Delete the constant

Click Delete.
A constant name must be a valid identifier, that is, it must consist of the characters ”_ a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z” and digits. The first character in the name must not be a digit. Constant names must not contain blank spaces or special symbols.