CLEAR NAMESPACE

From Lianjapedia
Jump to: navigation, search

Purpose

Release namespace dynamic arrays

Syntax

CLEAR NAMESPACE

See Also

CLEAR, CLEAR ALL, CLEAR MEMORY, NAMESPACE, NAMESPACE(), RELEASE, REMOVEPROPERTY(), STORE

Description

The CLEAR NAMESPACE command releases all namespace dynamic arrays.

Individual public variables can be released by removing them as properties of the namespace dynamic array/object using REMOVEPROPERTY().

Example

procedure proc1
namespace namespace1
messagebox("Namespace is " + namespace())
public pub1 = "Public variable declared in proc1"
return
 
procedure proc2
namespace namespace2
messagebox("Namespace is " + namespace())
public pub1 = "Public variable declared in proc2"
return
 
clear memory 
proc1()
proc2()
display memory
? namespace1.pub1
? namespace2.pub1
namespace
messagebox("Namespace is " + namespace())
public pub1 = "Public variable, no namespace active"
? pub1
?
display memory
clear namespace
clear memory
display memory

output


Namespaces:
------------------------
NAMESPACE1 Dynamic array (refcnt 2)
.PUB1       Character 'Public variable declared in proc1'
NAMESPACE2 Dynamic array (refcnt 2)
.PUB1       Character 'Public variable declared in proc2'


Memory Variables:
------------------------

** Total of ** 4 variables defined and 322 bytes used.
Public variable declared in proc1
Public variable declared in proc2
Public variable, no namespace active


Namespaces:
------------------------
NAMESPACE1 Dynamic array (refcnt 2)
.PUB1       Character 'Public variable declared in proc1'
NAMESPACE2 Dynamic array (refcnt 2)
.PUB1       Character 'Public variable declared in proc2'


Memory Variables:
------------------------
public variables:
PUB1       public  Character 'Public variable, no namespace active'

** Total of ** 5 variables defined and 486 bytes used.

Memory Variables:
------------------------

** Total of ** 0 variables defined and 0 bytes used.