Command CLEAR MEMORY Foundation

Releases all PUBLIC and PRIVATE variables and empties the GetList array.

Syntax
CLEAR MEMORY
Description

The command CLEAR MEMORY deletes all memory variables declared as PRIVATE or PUBLIC from memory. The exceptions are the variables GetList (used by the Get system) and PromptList (used by the menu system). Both are deleted only when they are declared as PRIVATE. In this case the PUBLIC variables of the same name become visible again. LOCAL and STATIC variables cannot be released using CLEAR MEMORY.

Examples
CLEAR MEMORY
// The example shows the effect of CLEAR MEMORY on 
// 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" 

  ? cStatic                  // result: STATIC Var 
  ? cLocal                   // result: LOCAL Var 
  ? cPrivate                 // result: PRIVATE Var 
  ? cPublic                  // result: PUBLIC Var 

  CLEAR MEMORY 

  ? cStatic                  // result: STATIC Var 
  ? cLocal                   // result: LOCAL Var 

  ? cPrivate                 // runtime error: variables 
  ? cPublic                  //         no longer exist 

RETURN 

Feedback

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.