Name A string literal (without quotes) representing the name of a window or module, or an at-sign followed by the name of a local variable (@name) where the value of that variable is expected to be equal to the name of a window or module at run-time.
Parameters Either an expression or a period, followed by the name of an (unsubscripted) array (similar to an array passed "by reference" to a subroutine or function). When the name of an array is specified, this array can contain both input and output variables stored in named subnodes. Within the called window the array is accessed using the macro %%IOVar. Any structure may be manipulated in this array.
Settings An expression or array containing
properties and settings which will override property settings
already in the window. Format alternatives are:
%%Do looks for a module named Name, and if one is not found it then looks for a window named Name. In this way a window may evolve into a module without the invocation of the window needing to change.
If a module is being done, the module program is called. If a window is being done, the window is loaded if necessary and made visible; focus is set to the starting control if any, and the compiled window program is called.
When a module is called using %%Do its Enter action logic is performed. Unless %%NotOK has been executed, when the Enter logic quits the Exit action logic is performed.
S P("Pattern")="*.TXT"
%%Do(GetFile,.P)
I $D(P("File")) D ...
Create a parameter to be input into a window in array element
P("Pattern") (presumably a pattern to be matched by
candidate file names).
Call a window named "GetFile" (presumably to ask for
the name of a file).
Do something if a value (presumably the name of a file) name was returned
in array element P("File").
%%Do(Palette,.P,%%CurrWin)
Invoke a window called "Palette",
send and return parameters in the array P().
In this case, the third parameter specifies that the
current window is the parent of the invoked window.