contents.gifindex.gifprev1.gifnext1.gif

3.4 Creating, Modifying, Inquiring, and Destroying Controls

Create

You create controls using the DISPLAY statement. You can either specify the control's characteristics directly in the DISPLAY statement, or you can refer to a Screen Section entry that defines one or more controls. If you do not use the Screen Section, then the DISPLAY verb returns a handle to the new control. For Screen Section controls, the runtime automatically creates and stores the handle for you.

Modify

Use the MODIFY verb to change the properties of a control. The MODIFY verb takes a control's home position (upper left corner), its handle, or the name of an elementary Screen Section item, as its first parameter. Only the properties of the control that are specified in the MODIFY statement are updated.

In addition, you can use the DISPLAY statement to update the properties of a control specified in the Screen Section. When a DISPLAY statement is used, the runtime compares the control's current specification with its original specification in the Screen Section and changes any aspects that are different. For example, if you want to change the value of a control, simply change the VALUE data item referenced in the Screen Section and DISPLAY that Screen Section entry.

Inquire

You can use the INQUIRE verb to get information about a control, including its value, without having to activate the control. The INQUIRE verb is used to retrieve a control's current title, value, and other control-specific properties. See the entry for INQUIRE in Book 3, Chapter 6, section 6.6.

Destroy

Use the DESTROY verb to destroy a control. The DESTROY verb takes a control's home position (upper left corner), its handle, or the name of an elementary Screen Section item, as its first parameter. Note that the runtime automatically destroys controls associated with a floating window when the floating window is destroyed.

The following table specifies the COBOL verbs used to create, display, modify, and destroy controls. Note that when controls are created individually with the DISPLAY verb, the controls' handles must be managed by the program. For a discussion of handles, see Chapter 4, section 4.1.

CONTROLS
Defined
individually
Defined in the
SCREEN SECTION


Create
DISPLAY
DISPLAY


Accept
ACCEPT
ACCEPT


Modify
MODIFY
DISPLAY, MODIFY


Destroy
DESTROY
DESTROY