Returns the list of variables defined in the current HyperMath session. |
||
Syntax |
t = who() t = who('global') |
|
Argument |
Name |
Description |
|
'global' |
An optional string, used to return global variables. |
Outputs |
Name |
Description |
|
t |
A table of strings. |
Example |
Syntax |
|
|
// Remove all previous variables defined ClearAll(); // Define A as a global variable global A; A = 2; B = 3; // Get list of local variables: 'A' (global and local here) and 'B' t1 = who(); print('local variables: ') for k = 1, Length(t1) do print(t1(k)) end // Get list of global variables: 'A' (here) t2 = who('global'); print('global variables: ') for k = 1, Length(t2) do print(t2(k)) end |
|
|
Resultlocal variables:ABglobal variables:A |
|
Comments |
t = who() returns the list of variables in the current HyperMath session. t = who('global') returns the list of variables declared 'global' in the current HyperMath session. |
|
See Also: |