Const
From Real Software Documentation
Declares a value as a local constant.
Syntax
Const constantname = value
| Part | Type | Description |
|---|---|---|
| constantName | String literal | The name of the constant. |
| value | Any data type. | The value to assign to the constant. |
Notes
The Const statement can be used in place of the Dim statement followed by an assignment statement when you are sure that the value of the variable should not change within the method. Using Const instead of Dim provides a convenient way to manage such values.
A ConstConstants declared in this manner are local to the method. You can also create constants in a window, class, or module, as described in the User's Guide. Constants that belong to windows or classes can be public (accessible throughout the application), protected (accessible only within the object that owns the constant and its subclasses), or private (accessible only within the object that owns it). Modules can have global constants, accessible throughout the application.
Examples
The following constant is used to set a button’s caption.
BevelButton1.caption=Accept
The following sets the value of “Pi” for the method.
See Also
Dim statement.
