up previous next
ImportByRef, ImportByValue

import an external variable by reference or value

Syntax
ImportByRef X;
ImportByValue X;
  where 
    X  
 is the name of a variable in the containing scope.

Description
***YOU PROBABLY SHOULDN'T USE THESE COMMANDS YET!*** It seems that they can be used only inside anonymous functions (see func ).

These commands "import" an external variable by reference or value. ImportByValue creates a local variable with the given name, and its initial value is taken from the variable of the same name in the context the anonymous function is defined. ImportByRef creates a reference to the named variable in the context where the anonymous function is defined.

NOTE: Package variables should be accessed directly (via their fully qualified names); they cannot be imported.

Example
/**/  Define add(X)
/**/    AnonFn := Func(Y) ImportByValue X; Return X+Y; EndFunc;
/**/    Return AnonFn;
/**/  EndDefine;
/**/  add3 := add(3);
/**/  add3(2);
5

See Also