Edit a Global Variable Definition Frame
From the Edit Global Variables catalog frame, you can modify the definition of a global variable by highlighting the name of the variable and selecting the Edit menu item. You see the Edit a Global Variable Definition frame, shown in the following figure:
This frame contains the following fields:
Name
(Read-only) Displays name of the global variable you entered on the Create a Global Variable frame.
Short Remark
(Optional) Provides a brief description
Type
(Required) Specifies the data type of the global variable. The name of any record type defined for this application or any Ingres type. ABF checks this whenever the value is changed on the form. The data type you enter here determines whether you fill in the Nullable or the Array field next.
• If you enter an Ingres data type, you see the Nullable field.
• If you enter the name of a record type created for the application, you see the Array field.
Nullable
Indicates whether the global variable is nullable. Only attributes of an Ingres type can also be nullable. Record types cannot be nullable. The default depends on the application query language: "yes" for SQL and "no" for QUEL.
Array
Indicates whether this global variable is a single record or a dynamic array of records. Arrays cannot be composed of Ingres data types.
The following menu operations are available from this frame:
LongRemark
Reads or edits the Long Remark pop-up frame
Print
Prints the definition of the global variable
ListChoices
Displays a list of legal values for the field from which you can choose or a field description
Cancel, Help, End
Perform standard operations
Edit a Global Variable Definition
You can change the features of an existing global variable with the Edit a Global Variable Definition frame.
To edit a global variable definition
1. Select the Edit menu item from the Edit Global Variables frame to display the Edit a Global Variable frame.
The Name field is display only. You cannot change this here.
2. In the required Data Type field, enter the name of any
Ingres data type or any record type defined for this application.
3. The next field is either the Nullable or the Array field, depending on the data type you enter. For more information, see The Edit a Global Variable Definition Frame section.
4. You can modify the optional Short Remark here.
5. You can enter or view more detailed information about the global variable by selecting the LongRemark menu operation. This displays the LongRemark pop-up, shown in the following figure:
Constants and Record Types have similar LongRemark pop-ups.
How to Set Initial Values for Global Variables
After you create a global variable, you must set its initial value before using it in your application. You must do this in the 4GL code for the application's starting frame or procedure. This ensures that you have initialized it before the application calls any frames or procedures that use the global variable.
When testing a frame that uses a global variable, start the application with the frame that initializes it. Then, proceed to the frame that you want to test. Otherwise, the test frame cannot run properly, because the statements that initialize its global variables have not been run.
See the 4GL section of this guide for a procedure that you can use to check whether you have set the initial value of a global variable. You can call this procedure from any frame or procedure that calls the global variable.
Last modified date: 08/28/2024