Const (Reserved Word)    same as Consts, Constant, Constants

image\trumpet2.gif Disclaimer

The reserved word Const(orConsts, Constant, Constants) is used to specify the name of a user-declared constant, its value, and optional data type.  This must be done before a user-declared constant can be used in an assignment statement or formula.  Multiple constants may be declared in a single Const statement by separating the constants using commas.

Syntax-Common

Const: Name(Value) ;

Where Name is the unique name of the user-declared constant, and Value is a numeric value, Boolean value (true or false), or string (text) value that sets the value of the constant.

Syntax-Complete

Const: <DataType> ConstName(ConstantValue) <, <DataType> ConstName(ConstantValue)> ;

  • Const is the constant declaration statement that may alternately be typed as Consts, Constant, or Constants.

  • DataType is the optionally supplied data type (float, double, int, string, and bool) of the constant

  • ConstName is the user specified constant name that can be up to 20 characters long and must begin with an alphabetic character (names are not case sensitive)

  • ConstantValue is the constant value.

Remarks

A constant name can contain alphanumeric characters plus the period ( . ) and the underscore ( _ ). The use of a period should be avoided since the period, or "dot," is an operator in EasyLanguage.

A constant name can not start with a number or a period ( . ).

The value of a constant is declared by a number in parenthesis after the input name.

Multiple constants names may be declared using a single Const statement where the names are separated by commas.

The use of the reserved words Const, Consts, Constant, and Constants is identical.

Like inputs, constants can be used to set the values of object properties in the Properties Editor.

Examples

Const: Pi(3.1416);

Declares the constant Pi and sets the value as specified where the type is set based on the value.

Consts: int MyValue(1025), double MyFactor(27.3618);

Declares the constant MyValue as an integer value of 1025 and MyFactor as a double-precision floating-point value of 27.3618.