list variables ...

Prev Next

Function Names

list variables, list system variables, list global variables, list local variables

Description

These functions list the contents of all / system / global / or local variables. For every variable and the members, the types are displayed as well as protection settings. Regarding types: 'string' means softquoted string and "string" means quoted string.

Hint: This function is suitable for interactive and debugging.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

0, 1

Parameters

No.TypeDescription
1
input
string Variable search string

The search string narrows down the name of the base variable to be included in the listing. Wildcard symbols are supported here.

Examples

    define procedure( foo, {{ parameter passed, string }} )
    {
       echo("All local variables:");
       abc[] = Hello World;
       def[] = 123;
       list local variables;
       echo("Some global variables:");
       list global variables('my*');
    }

    my world[] = Globe;
    my continents[Europe] = {UK, Germany, France};
    my continents[Africa] = {Namibia, Egypt, Ivory Coast};
    my continents[Asia] = { India, Thaland };

    echo("All system variables with base variable name beginning with 'r':");
    list system variables("r*");

    foo(Works beautifully);

Output

All system variables with base variable name beginning with 'r':

Variable List Level = 0  Regional Level = 0    System variables
-------------------------------------------------------------------------------
runtime settings        [Void]                     (void,read only)
  crlf                  true                       (boolean,limited access)
  epsilon               0.0000000001               (plain numeral,limited access)
  exit directly         true                       (boolean,limited access)
  file search ignore case  true                       (boolean,limited access)
  found main            false                      (boolean,limited access)
  input file character set  win1252                    (string,limited access)
  memorize table columns  true                       (boolean,limited access)
  output file character set  utf-8                      (string,limited access)
  prompt                >>                         (string,limited access)
  registry my space     Software\B4P\My Space      (string,read only)
  verbose               quiet                      (quoted string,limited access)

All local variables:

Variable List Level = 2  Regional Level = 2    
-------------------------------------------------------------------------------
abc                     Hello World                (softquoted string,full access)
def                     123  "123"                 (numeral,full access)
function name           foo                        (quoted string,prevent deleting)
parameter count         1                          (plain numeral,prevent deleting)
parameter passed        Works beautifully          (softquoted string,prevent deleting)

Some global variables:

Variable List Level = 1  Regional Level = 1    Global variables
-------------------------------------------------------------------------------
my continents           [Void]                     (void,full access)
  Africa                3 elements:                (set,full access)
                          Namibia                    (softquoted string)
                          Egypt                      (softquoted string)
                          Ivory Coast                (softquoted string)
  Asia                  2 elements:                (set,full access)
                          India                      (softquoted string)
                          Thaland                    (softquoted string)
  Europe                3 elements:                (set,full access)
                          UK                         (softquoted string)
                          Germany                    (softquoted string)
                          France                     (softquoted string)
my world                Globe                      (softquoted string,full access)

Try it yourself: Open LIB_Function_list_variables.b4p in B4P_Examples.zip. Decompress before use.

See also

see
inspect
list tables
list functions