skip to main content

Procedure Division Statements : DESTROY

DESTROY
General Format
Format 1
DESTROY { {Screen-Name-1} } ...
Format 2
DESTROY ALL CONTROLS
Format 3
DESTROY CONTROL
Remaining phrases are optional, can appear in any order.
  AT Screen-Location
  AT LINE NUMBER Line-Num [CELL  ]
  AT {COLUMN  } NUMBER Col-Num [CELL  ]
     {COL     }                [CELLS ]
     {POSITION}                [PIXEL ]
     {POS     }                [PIXELS]
Syntax rules
1.
Screen-name-1 is the name of a screen description entry found in the Screen Section.
2.
Handle-1 is a USAGE HANDLE or PIC X(10) data item.
3.
Screen-location is an integer data item or literal that contains exactly 4 or 6 digits.
4.
Line-num and col-num are numeric data items or literals. These may contain non-integer values.
General rules
Format 1
1.
2.
If Handle-1 refers to a sub-window, the result is the same as a CLOSE WINDOW, causing all controls on that window to be DESTROYed. All chile windows are also DESTROYed.
3.
If Handle-1 is a handle of a menu or layout manager, the controlling window should be DESTROYed before the handle
4.
5.
If Handle-1 is a handle of bitmap or menu, the DESTROY verb has no effect. Use WBITMAP-DESTROY to destroy a bitmap handle and WMENU-DESTROY to destroy a menu handle.
6.
If Handle-1 is a handle of one of the system pre-defined font (fixed-font, traditional-font, default-font, small-font, medium-font or large-font) the DESTROY verb has no effect.
Format 2
1.
Format 3
1.
Examples
Format 1 - Destroy a screen.
display input-screen-1
perform until esc-pressed
  accept input-screen-1
destroy input-screen-1
Format 1 - Destroy window.
display initial  window 
        screen line 10 screen column 10
        size 40.0 lines 25.0
        cell width 10 cell height 10
        title "Customer Information"
        handle cust-win-handle
destroy cust-win-handle
Format 3 - Destroy controls by line and col position.
display entry-field line 5.0 col 20.0
display label line 5.0 col 3.0 title "Customer code: "
destroy control line 5.0 col 3.0
destroy control line 5.0 col 20.0

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left