Command CLEAR ALL Foundation
Closes all files and releases all PRIVATE and PUBLIC variables.
CLEAR ALL
The command CLEAR ALL closes all files open in all work areas and releases all memory variables declared as PRIVATE or PUBLIC. After CLEAR ALL, the first work area is selected and an empty array is assigned to the PUBLIC variables GetList (for use by the Get system) and PromptList (for use by the menu system).
CLEAR ALL exists only for compatibility reasons. Files should be closed with the command CLOSE. Dynamic memory variables (PRIVATE and PUBLIC variables) should be released using RELEASE.
// The example shows the effect of CLEAR ALL on files and
// variables with varying visibility.
PROCEDURE Main
MEMVAR cPrivate, cPublic
STATIC cStatic := "STATIC Var"
LOCAL cLocal := "LOCAL Var"
PRIVATE cPrivate:= "PRIVATE Var"
PUBLIC cPublic := "PUBLIC Var"
USE Customer NEW
USE Invoice NEW
USE Part NEW
? Select() // result: 3
? Alias() // result: PART
? cStatic // result: STATIC Var
? cLocal // result: LOCAL Var
? cPrivate // result: PRIVATE Var
? cPublic // result: PUBLIC Var
CLEAR ALL
? Select() // result: 1
? Alias() // result: (Null string(""))
? cStatic // result: STATIC Var
? cLocal // result: LOCAL Var
? cPrivate // runtime error: variables no
? cPublic // longer exist
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.