2. Language Elements : Expressions : Literals : Named Constants
 
Share this page                  
Named Constants
A named constant is a literal value to which you give a name. You can then use the name in place of the constant in any 4GL expression. You specify the value for the named constant when you create it with the OpenROAD Workbench. This constant is global to the application.
You must use the Constant Editor to change the value of a constant. Although you can reference the named constant in your 4GL code, you cannot change its value at runtime.
Constants let you substitute a brief name for a long phrase or value that is used in several places, for example, if you have encoded a set of values as integers for storage. Constants also provide a consistent reference for message strings, for example, in internationalizing products.
To reference a named constant from your 4GL code, use the constant name, for example:
if salary > HISALARYVALUE then ...
For more information about using the Constant Editor, see the Workbench User Guide.