AMT Datasouth PAL User Manual
Page 82
cvx
76
must specify the file object associated with the file. By specifying the file object, the programmer
informs PAL which file to read or write.
Normally, the PAL interpreter reads the standard file %stdin to receive operations to perform.
However, the programmer can use the exec operator to specify an different file for the interpreter
to read. However, the exec operator requires that the programmer specify an executable file object
and not a literal file object. Therefore, the programmer must use the cvx operator to convert the
literal file objects returned by file and _devicefile to executable.
Hints
The cvx operator provides the programmer with very advanced capabilities which only the most
advanced applications will require.
As mentioned above, the programmer can store the names of procedures within a database
constructed from array and/or dictionary objects. The following provides an example of this type
of database.
1:
/WidgetProc {36 36 moveto (Widget) show} bind def
2:
/BobbelProc {36 36 moveto (Bobbel) show} bind def
3:
/Parts <<
4:
/Widget [12.95 6 /WidgetProc]
5:
/Bobbel [99.95 8 /BobbelProc]
6:
>> def
7:
8:
Parts /Widget get 2 get cvx exec showpage
9:
Parts /Bobbel get 2 get cvx exec showpage
Lines 1 and 2 define unique page drawing procedures for each part in the Parts database. Lines 3
through 6 define the actual parts database. Each database entry contains the name of the part as the
key, and an array of data associated with each part. The array contains the part's price, the quantity
on hand, and the name of the part's page drawing procedure. Lines 8 and 9 recall each part from
the Parts database and print the page associated with the part.