:CONST, :CONSTANT
Script Statement: Creates a script variable as a constant with a specific value.
Syntax
:C[ONST[ANT]] Variable name = Value
Syntax |
Description/Format |
---|---|
Variable name |
The name of the script variable that should be defined as a constant. You must always use an ampersand symbol (&) that precedes the script variable's name, and it is recommended that you use a hash (#) symbol to signal the end of the variable's name. The length of a script variable's name is limited to 32 characters. All characters of the alphabet, the numbers 0-9, and the following special characters can be used:"$", "_", "@", "ยง" and "#". German Umlauts are not allowed. The first character after the leading "&", which is not part of the 32-character limit, must neither be a number nor a "$" symbol. For more details about the syntax, see Syntax Format: script variable |
Value |
The value of the constant. Format: script literal, script variable or script function This value cannot be changed subsequently. |
Comments
This script element creates a new variable as a constant and assigns a specific value to it. As opposed to variables that you create with :SET, the values of constants are write-protected and cannot be changed subsequently.
Important!
- You cannot use this script element to convert an existing script variable to a constant. This includes that you cannot use a name of an existing variable.
- You cannot create a constant with :DEFINE. This includes that they do not have a certain data type.
- :CONST automatically rounds floating-point numbers up or down. To save floating-point numbers, use :DEFINE.
Examples
:CONST &COMPANY# = "CA Technologies"
:CONST &PI# = 3.1415
See also:
Script Element | Description |
---|---|
:DEFINE | Define a variable and declares the data type of the variable. |
Assigns a value to an object variable. |
|
Assigns a value to a script variable. |
|
Sets the values of script variables by indirect access. |
Script Elements - Script Structures and Processing
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function