Constants

Constants are expressions that are evaluated and then stored under a symbolic name. Constants are used for values that must be known by a symbolic name but that will not be changed by the script. For instance, any paths for files used or generated by the script could be assembled at the start of the script and stored under a meaningful name:

Const Text checkdir = "TempDir\checkdir";

In this example the constant checkdir is set to contain the path to the directory checkdir inside the TempDir. This TempDir is a local constant that contains the temporary directory for the Document Processor that is running the script. Refer to Location constants for more information.

Constant names

Constant name's rules:

Local constants

Every ITP/Server Service Script can declare its own constants. These constants are accessible only within the script.

Constants syntax

Const type name = value;

Constants can be defined everywhere in the script, but they must be defined before they can be used. The value of the constant is evaluated at the moment that it is defined. A constant can only be defined once in a script.

The declaration assigns a type to the constant and only values with that type can be assigned to the constant. There are three kinds of constants:

Note

Values type Number in ITP/Server must lie between -2.147.483.648 and +2.147.483.647.