Clear: Difference between revisions
(→Syntax) |
(→Syntax) |
||
Line 2: | Line 2: | ||
==Syntax== | ==Syntax== | ||
CLEAR {[PROC [ONLY]]|[RESIDENT [STATUS]]|[<resident library> [STATUS]]|[ALL]} | CLEAR {[ [[PROC]] [ONLY]]|[RESIDENT [STATUS]]|[<resident library> [STATUS]]|[ALL]} | ||
[[File:Clear.png]] | [[File:Clear.png]] |
Latest revision as of 15:09, 6 May 2014
The Clear command deletes a program and data from memory and/or closes any active procedure files. It is useful for ensuring that memory is empty before you begin typing in a new program.
Syntax
CLEAR {[ PROC [ONLY]]|[RESIDENT [STATUS]]|[<resident library> [STATUS]]|[ALL]}
Comments and Examples
If a BR program is active in memory when you type CLEAR ALL and press <ENTER>, its files are closed and the program terminates. Memory space is cleared for you to begin entering new program lines.
The following are examples of the CLEAR command:
CLEAR ALL
CLEAR PROC
CLEAR PROC ONLY
CLEAR RESIDENT
CLEAR RESIDENT STATUS
CLEAR "resident-library-name"
CLEAR "resident-library-name" STATUS
Defaults
- Clear main program from memory, leave active procedure files and resident library programs open, and prepare for program entry.
- Close all active procedure files and end program.
- Clear the specified resident libraries from memory
Parameters
ALL terminates the current program, closes all active procedure files and clears memory.
When PROC is the only parameter used with the CLEAR command, it also closes all active procedure files, but it leaves memory intact, thus variable values are still available for debugging.
When the PROC and ONLY parameters are specified together, BR closes all active procedure files but it does not end the current program and it leaves memory intact with all variable values still available.
The RESIDENT parameter indicates that the CLEAR operation is to be performed on all libraries currently loaded resident. When this parameter is not followed by the STATUS parameter, BR clears all resident libraries from memory. Note that if any linkages are active for any of the libraries, an error will result when this operation is attempted. If the STATUS parameter is included, then the resident libraries are demoted from resident status to present status.
The resident library name parameter indicates that the CLEAR operation is to be performed on the specified library. When this parameter is not followed by the STATUS parameter, BR clears the specified resident library from memory. Note that if any linkages are active for any of the libraries, an error will result when this operation is attempted. If the STATUS parameter is included, then the named resident library is demoted from resident status to present status.
Technical Considerations
BR performs an implicit CLEAR whenever the CHAIN statement or the LOAD command are executed.
The CLEAR command handles the following library-related tasks:
- Clear a named resident library from memory.
- Clear all resident libraries from memory.
- Remove the resident status of a named library, turning it into a present library.
- Remove the resident status of all resident libraries, turning them all into present libraries.