Navigation: Language Reference > 13 - Built-in Functions >====== DESTROY (remove a control) ====== | ![]() ![]() ![]() |
DESTROY( [ first control ] [, last control ] )
DESTROY | Removes window controls. |
first control | Field number or field equate label of a control, or the first control in a range of controls. If omitted, defaults to zero (0). |
last control | Field number or field equate label of the last control in a range of controls. |
The DESTROY statement removes a control, or range of controls, from an APPLICATION or WINDOW structure. When removed, the control's resources are returned to the operating system.
DESTROYing a GROUP, OPTION, MENU, TAB, or SHEET control also destroys all controls contained within it.
Example:
Screen WINDOW,PRE(Scr)
ENTRY(@N3),USE(Ctl:Code)
ENTRY(@S30),USE(Ctl:Name)
BUTTON('OK'),USE(?OkButton),KEY(EnterKey)
BUTTON('Cancel'),USE(?CanxButton),KEY(EscKey)
END
CODE
OPEN(Screen)
DESTROY(?Ctl:Code) !Remove a control
DESTROY(?Ctl:Code,?Ctl:Name) !Remove range of controls
DESTROY(2) !Remove the second control
See Also: