LOTUSSCRIPT LANGUAGE


Const statement
Example

Defines a constant.

Syntax

[ Public | Private ] Const constName = expr [ , constName = expr ]...

Elements

Public | Private


constName
expr Functions that can be evaluated as LotusScript constants

Abs

ACos

ASin

ATn

ATn2

Bin

Cos

DataType

DateNumber

Exp

Fix

Fraction

Hex

InStr

InStrB

Int

LCase

Left

LeftB

Len

LenB

Log

LTrim

Mid

MidB

Oct

Right

RightB

Round

RTrim

Sgn

Sin

Sqr

Str

Tan

TimeNumber

Trim

TypeName

UCase

Val


Usage

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.


These rules are illustrated in the examples following.

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