:CONST, :CONSTANT
Use the :CONSTANT script statement to create a new script variable as a constant and assign a specific value to it. Unlike variables created with the :SET script statement, the values of constants are write-protected and cannot be changed subsequently.
Important Considerations
-
You cannot use this script element to convert an existing script variable to a constant. Therefore, you cannot use the name of an existing variable.
-
You cannot create a constant with the :DEFINE script statement. Constants do not have a specific data type.
-
The :CONST script statement automatically rounds floating-point numbers up or down. To save floating-point numbers, use :DEFINE.
Syntax
: C[ONST[ANT]] Variable name = Value
Parameters
| Parameter | Description | Format |
|---|---|---|
| Variable name |
Name of the script variable to be defined as a constant. The name is limited to 32 alphanumeric characters, including the special characters "$", "_", "@", "ยง" and "#". German umlauts are not allowed. The first character must not be a number. Variables must always be specified with a leading "&" followed by the variable name. |
Script variable |
| Value |
Value of the constant. Important! You cannot change this value subsequently. |
Script literal, script variable, or script function |
Examples
: CONST &COMPANY# = "CA Automic"
: CONST &PI# = 3.1415
See also: