Data type conversion
LotusScript implicitly
converts data from one type to another in the following situations.
Explicit data type conversion
LotusScript provides
several built-in functions for explicitly converting a value's data
type. These functions include CBool, CByte, CCur, CDat, CDbl, CInt,
CLng, CSng, CStr, and CVar.
Automatic data type conversion
LotusScript can
automatically convert values from one data type to another. Automatic,
or implicit data type conversion happens when:
Constants and Variables
A LotusScript application
can manipulate data of several types through the use of constants
and variables. Constants andvariables are identifiers that name locations
in memory containing data of one or another of the types that LotusScript recognizes.
Constants differ from variables in that the value that a constant
represents must be known at compile time and can't be changed -- it
must remain constant -- while the application is running, while a
variable can refer to a value (or a set of values) that can change
while the application is running.
Scope of declarations
Scope is the context in which a variable, procedure, class,
or type is declared. Scope affects the accessibility of an item's
value outside that context. For example, variables declared within
a procedure are typically not available outside of the scope of that
procedure.
Constants in LotusScript
A constant names a location in memory that contains a value
that is known at compile time and cannot be changed while the application
is running. In less formal terms, a constant is a named fixed value.
Constants are defined in the following ways:
Variables
A variable names an area of storage whose value can change
during execution of an application.
Arrays
An array is a named collection of elements of the same
data type, where each element can be accessed individually by its
position within the collection. A LotusScript array can have a maximum
of eight dimensions.
Lists
A list is a one-dimensional collection of elements of the
same data type. You can change the size of a list at any time while
the application is running and LotusScript does
not allocate any storage space at compile time for the elements of
a list. Lists automatically shrink or grow when elements are deleted
from or added to them. You access each element in a list by a unique
String value, called a list tag.
Variants
Variant is a special data type: variables of type Variant
can hold values of any of the following data types that LotusScript recognizes, except for user-defined
data types: