HyperMath

Workspace Management

Workspace Management

Previous topic Next topic No expanding text in this topic  

Workspace Management

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Clear(var)

Clear(var,'base')

Clear(var,'local')

Clear(var) clears the specified base or global variable from memory.

Using 'base' or 'local' clears a variable in a specific scope.

Example

a = 1

Clear('a')

print(exist('a'))

b = 10

function foo1()

    b = 333

    print(b);

    Clear('b', 'local') // remove b variable in local scope

    print(exist('b', 'local'))

    print(exist('b', 'base'))

end

function foo2()

    Clear('b', 'base') // remove b variable in base scope

end

foo1();

print(b)

foo2(); 

print(exist('b','base')) // check existence of 'b' in base scope

See Also

exist()

ClearAll()

Clears all base or global variables from memory.

ReleaseMemory()

Releases unused memory.  This may help better memory management for large data sets.