LOTUSSCRIPT LANGUAGE
Defines a constant.
Syntax
[ Public | Private ] Const constName = expr [ , constName = expr ]...
Elements
Public | Private
A constant is Private by default.
If you declare a constant within a procedure, you cannot use Public or Private.
The expression can contain any of the following.
ACos
ASin
ATn
ATn2
Bin
Cos
DataType
DateNumber
Exp
Fix
Fraction
Hex
InStr
Int
LCase
Left
LeftB
Len
LenB
Log
LTrim
Mid
MidB
Oct
Right
Round
RTrim
Sgn
Sin
Sqr
Str
Tan
TimeNumber
Trim
TypeName
UCase
Val
The Public keyword cannot be used in a product object script or %Include file in a product object script, except to declare class members. You must put such Public declarations in (Globals).
A constant is a named variable whose value cannot be changed. You can declare a constant in a module or a procedure, but you cannot declare a constant in a type or class definition.
You can specify the data type of a constant by appending a data type suffix character to constName. Alternatively, if the constant is numeric and expr is a numeric literal, you can specify the data type by appending a data type suffix character to expr.
If you do not append a data type suffix character to constName or expr, LotusScript determines the data type of the constant by the value assigned to it.
Whether you specify a suffix character in the Const statement or LotusScript determines the data type based on the constant's value, you can use the constant in a script with or without a data type suffix character. If you use the constant with a suffix character, the suffix character must match the data type of the constant.
The data type of a constant is not affected by Deftype statements.
Example See Also