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.

Like other identifiers, constants and variables have a scope and a lifetime. Scope refers to the area of an application in which an identifier can be referred to, that is, the area in which the identifier is accessible, or known. Lifetime (or persistence) refers to the period during which the identifier is available to the application. When you define a constant or declare a variable, LotusScript® assigns it a default scope and lifetime, which in some cases you can override by including the appropriate keyword in the definition or declaration.

The specific areas of an application in which a constant or variable (or any other identifier) is known, and for what duration, depend on the application model that a product and its programming environment support. The following diagram shows a generic application model and the areas in which you can define constants and declare variables:

Shows several modules making up one application