:CONST, :CONSTANT

Use the :CONSTANT script statement to create a new script variable as a constant and assign a specific value to it. As opposed to variables that you create with the :SET script statement, 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. Therefore, you cannot use a name of an existing variable.
  • You cannot create a constant with the :DEFINE script statement. Constants do not have a certain 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

  • :C[ONST[ANT]]
    Creates a script variable as a constant with a specific value

  • Variable name
    Name of the script variable that should be defined as a constant.
    Format: script variable
    The name of a script variable 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 within the script must always specified with a leading "&" following the variable name.

  • Value
    Value of the constant
    Format: script literal, script variable or script function
    Important! You cannot change this value subsequently.

Examples

:CONST &COMPANY# = "CA Automic"
:CONST &PI# = 3.1415

See also: