Adding a Global Constant
You can add a global constant to an existing category or to a new global constant category.
You cannot define a global constant that conflicts with a global constant defined in a superschema.
To add a global constant
-
In the Global Constant Browser, select the category to which the global constant is to be added.
-
Select the Add command from the Constants menu.
The Define Constant dialog, shown in the following image, is then displayed.
-
In the Name text box, specify the name of the global constant that you want to define.
The constant name starts with an initial capital letter (for example, TestConst) and it must be unique to the schema to which it is being added.
-
In the Type combo box, select the required primitive type in the Type list, or specify the first character or the first few characters of the primitive type in the text box and then select the required primitive type from the Type list. The selected primitive type is then displayed in the Type text box.
The type can be any primitive type to which you want to assign a constant value; for example, an integer value of 1 or a string value of "cerise".
-
In the Definition editor pane, specify the definition of your global constant. The definition can be a simple literal value or a more-complex expression.
For tips about defining global constant values, see "Constant Definition Tips", earlier in this chapter.
-
Check the Subschema Hidden check box if you want to specify that the global constant is available only in the local schema; that is, it is not available for use in any subschemas.
For details, see "subschemaHidden Option" under "Controlling the Use of Elements in Other Schemas", in Chapter 1.
-
Click the Enter Text button if you want to specify or maintain descriptive text for the global constant as part of the definition or maintenance of the constant. For details, see "Specifying Text for a Schema Element", in Chapter 3.
You can also specify descriptive text for the global constant at any time, by selecting the Text command from the Constants menu. For details, see "Using the Free-Standing Editor Window to Define Text", in Chapter 3.
-
Click the Search for Duplicates button if you want to determine if a global constant with an identical definition value exists in the current schema or any superschema.
If an existing definition value is located, a message box displays the name of the global constant containing that definition, category, and schema in which it is defined.
-
Click the OK button.
Alternatively, click the Cancel button to abandon your selections or the Next button to define another global constant.
The specified global constant is then displayed in the Global Constants List of the Global Constants Browser, with the value that you defined for the global constant displayed in the definition pane.