: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.

A script variable's 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 within the script must always specified with a leading "&" following the variable name!

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.

Note that you cannot use this script element in order 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.

Please note that :CONST automatically rounds floating-point numbers up or down. To save floating-point numbers, please use :DEFINE.

Examples

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

See also:

Script Element Description
:DEFINE Declares a script variable with a particular data type.

:PSET

Assigns a value to an object variable.

:SET

Assigns a value to a script variable.

:SET_SCRIPT_VAR

Sets the values of script variables by indirect access.