An execution model is applied to the constructs defined by the Data Explorer scripting language. This model consists of the environment structure that is maintained during function calls, the behavior associated with macro expansions, the scope rules used for locating the value associated with a variable, and the semantics associated with assignment statements and function calls.
All global assignment statements and initial function invocations occur in the top-level environment. This environment is special in that all assignment statements and function invocations initiated in this environment are always executed.
When either a macro or a module function is executed, a new dynamically scoped environment specific to that function call is created. Variables that correspond to the function's input and output formal parameters are created in this new environment. The variables corresponding to the output formal parameters are initialized to NULL. Those variables corresponding to the input formal parameters are initialized in the manner described in the preceding section. If an input and an output formal parameter both have the same name, then they share a single parameter and are initialized to the value passed as input when the function is called.
When the function being called is a macro, the macro is effectively expanded in-line after first constructing the necessary environment for its input and output parameters. This guarantees that the partial orderings defined by macros are maintained.
The Data Explorer allows you to use variables on both the left and right sides of a function assignment; that is, as both left-side and right-side.
All assignments in a macro's environment affect variables that are local to the macro. These variables, if they do not already exist, are created in the macro's environment when they are first used on the left-h stream being sent to Data Explorer. The file being included can contain both scripting language constructs and executive commands. This means an included file can, in turn, include other files.
There is currently a limit of 32 nested levels of inclusion, after which the include commands are ignored.
To include the file my.script, issue the following command:
include "my.script"
The default prompt and continuation prompt are dx> and > respectively.
The following example show how to set these variables. Note that this example shows the Data Explorer prompts as they would be displayed in the executive.
dx> @prompt = "DATA EXPLORER>"; DATA EXPLORER> @cprompt = " more>";
If, after these commands, an incomplete statement was entered, Data Explorer would respond as follows:
DATA EXPLORER> a =
more> 3 * 5;
[ OpenDX Home at IBM | OpenDX.org ]