Exec – AMT Datasouth PAL User Manual
Page 98

exec
92
exec
Description
Execute the object on the top of the operand stack.
Usage
Any
exec
Any
Any. Object to execute.
Comments
As PAL encounters objects received from the host computer or contained in procedures, PAL
executes each object. In most cases, when PAL encounters an object, it marks the object as literal.
This means that PAL will treat the object as data. When PAL executes a literal object, it does
nothing more than push the object onto the top of the operand stack. Therefore, PAL simply
pushes most of the objects it encounters onto the operand stack.
The exec operator instructs PAL to "encounter" the object on the top of the object stack. As a
result, PAL pops the object off the stack and pretends it has just received the object from the host
computer. This causes the interpreter to execute the object. Just as in the case of objects received
from the host, literal objects on the top of the stack will simply result in PAL pushing the object
back onto the top of the stack.
However, it PAL encounters an executable object on the stop of the stack. It will perform the
operations associated with that executable object. Executable objects typically include name and
file objects which the programmer has converted from literal to executable using the cvx operator.
The cvx operator discussion includes using the exec operator in conjunction with the cvx
operator.