AMT Datasouth PAL User Manual
Page 81
75
cvx
cvx
Description
Converts a literal name or file object into a executable object.
Usage
LiteralFile
cvx
ExecFile
LiteralName
cvx
ExecName
LiteralFile
File. Literal file object to convert to executable.
ExecFile
File. Literal file object converted to executable.
LiteralName
Name. Literal name object to convert to executable.
ExecName
Name. Literal name object converted to executable.
Comments
When PAL encounters an object for execution, it checks the object's literal/executable attribute. If
the object has a literal attribute, PAL simply pushes the object onto the top of the operand stack. If
the object has an executable attribute, PAL attempts to perform any operations stored within the
object.
Under most circumstances, PAL automatically assigns objects the literal attribute. This means that
PAL will treat the objects as data whenever it encounters the objects.
Name Objects
Executable names provide the most notable exception to this rule. PAL requires the placement of a
slash character at the start of a name in order to specify a literal name. Without the preceding slash
character, PAL will treat a name as executable.
Programmers often find it beneficial to store within a database various references to procedures.
For example, the records within a parts database could include references to a procedure which
draws the picture of the part.
In order to store the name of each procedure within the database, the programmer must specify a
literal name. This prevents PAL from attempting to immediately execute the procedure. The cvx
operator allows the programmer to convert the literal name object to executable in order to execute
the associated procedure.
Once the programmer has converted a literal name to executable using the cvx operator, the
programmer must then use the exec operator to instruct the interpreter to execute the converted
name.
File Objects
The file and _devicefile operators return literal file objects. These objects provide a type of
pointer to the opened file. When the programmer wishes to read or write the file, the programmer