Loading...
 

Execute

Execute

Execute

Stack
Stack Position Description
Stack(In) Top a procedure
from Top-1 Parameters for the procedure
Stack(Out) depends on the code executed

A procedure put on the stack with () is called. In contrast to the second use of Execute (STRING parameter), here a procedure is called regularly and thus an entry is also created in the call stack, which means that break, continue, return only refer to the executed procedure and not to the enclosing procedure that executes the Execute .

One special feature is to be noted here: Anonymous procedures support so-called closures and therefore have access to the local variables of the defining procedure, as the example below shows. However, they cannot influence the flow of the enclosing procedure.

Define(Greet)   "Hello World!" Attention(,INFO) ; (Greet) Execute // equivalent to Greet // or ({ "Hello World!" Attention(,INFO) }) Execute Define(ClosureTest) LocalVar(x) ({ 12 -> x }) Execute x //-> 12 ;

Stack
Stack Position Description
Stack(In) Top InstantView® statement as a character string
from Top-1 other values required by the instructions...
Stack(Out) depends on the code executed

The string from the stack top must contain valid InstantView code, which is then translated and executed in the current context. In contrast to the above variant of Execute, the code is executed as if the code were directly in the procedure/message that executes the Execute and therefore this code also has the possibility to access local variables of this procedure or to influence the process via break, continue, return.

"\"Hello World!\" Attention(,INFO)" Execute

Related topics:
functional programming with InstantView