Defining Constants and Variables

Defining Environmental Constants

Figure 7 Constant or Variable Icon

Image of a Constant or Variable Icon

Environmental constants are name-value pairs that are visible across the Environment. Using a constant allows you to define the value once, and then refer to it from the various Project configurations, rather than having to redefine the value everywhere it is needed. Selecting the New > Constant option from the Environment context menu, which displays the Create Environmental Constant dialog box shown in the following figure.

Figure 8 Create Environmental Constant Dialog

Image of the Create Environmental Constant dialog
box, described in content

Table 5 Project Constant Options

Property 

Option 

Description/Usage 

Name 

 

Your name for the Environmental constant. 

Category 

 

You may assign a category name, if desired. 

Description 

 

Your description for the constant. 

Is a Constant 

 

Automatically selected, not modifiable. 

Value Type 

String 

Allows the string value to be displayed explicitly. 

 

Password 

Encrypts the value, displaying asterisks (*) in the field. 

Value 

 

The value for the constant. 


Note –

When you create an Environmental constant, you assign a permanent value to it which cannot be overridden.


Constants are automatically added to a Constants object group within the Environment, as shown in the following figure. All constants defined for the specific Environment are listed in the Constants section of the panel, along with their various properties. Additional Environmental Constants can be defined using the lower part of the panel.

Figure 9 Environmental Constants Object Group

Screen capture showing the Variables and Constants
Object Group user interface.

Table 6 Environmental Constants Object Group Icons

Icon 

Name 

Function 

Image of Add Constant or Variable Icon.

Add a New Constant 

Adds a new constant to the list. 

Image of Delete Constant or Variable Icon.

Delete a Highlighted Constant 

Deletes the selected constant from the list. 


Note –

Refer to the Java CAPS 6 Release Notes regarding this feature.