Example Of A Procedure Defined In Palt M; Example Of Calling A Procedure From A Host Application - AMT Datasouth Fastmark 600 Series User Manual

Fastmark 600 series with pal print and program language barcode label printer
Hide thumbs Also See for Fastmark 600 Series:
Table of Contents

Advertisement

Example of a Procedure defined in PAL
The following procedure is defined in Pal_Procs_and_Formats.txt and illustrates how PAL
combined in a procedure to create a completely new function or capability. The file Pal_Procs_and_Formats.txt must
be copied to the printer prior to using any of these utilities. The following utility shows how PAL
used to create a simple Box draw procedure. This Box procedure makes use of another procedure defined called
inchtopts. This procedure takes measurements in inches and converts to points which is the native unit used by
TM
PAL
. The advantage of using a procedure like this to draw boxes is to simplify the use of the PAL
Instead of issuing 7 PAL
left corner x,y, upper right corner x,y, and line width).
%========================================================================
% Box draw procedure
% Usage:
botX(in.)
% Example: 0.1
%
%
(topX, topY)
%
+--------*
%
|
%
|
%
*--------+
%
(botX, botY)
%
%========================================================================
/Box
{
/lwidth exch def
/topY exch def
/topX exch def
/botY exch def
/botX exch def
botX inchtopts botY inchtopts moveto
botX inchtopts topY inchtopts lineto
topX inchtopts topY inchtopts lineto
topX inchtopts botY inchtopts lineto
closepath
lwidth inchtopts setlinewidth
stroke
} bind def

Example of calling a Procedure from a host application

The two lines preceded by % are comment lines ignored by the PAL
transmitted to the printer. The last line shows the actual call to the procedure named Box defined in
Pal_Procs_and_Formats.txt. Note that floating point numbers must have a leading 0 for example 0.1 instead of .1.
Also note while the example below uses many spaces between parameters, this is only for clarity and only a single
whitespace character is actually needed i.e. 0.1 0.1 3.9 1.9 0.01 Box would also work.
% Box draw
% botX(in.) botY(in.)
0.1
0.1
Fastmark 600 Series User's Guide
TM
commands to draw a box, this single procedure may be called with 5 parameters (lower
botY(in.)
topX(in.)
0.1
3.9
|
|
topX(in.) topY(in.) lwidth(in.) Box
3.9
TM
topY(in.)
lwidth(in.)
1.9
0.01
TM
interpreter and don't actually need to be
1.9
0.01
TM
commands may be
TM
operators are
Box
Box
Box
TM
language.
54

Advertisement

Table of Contents
loading

Table of Contents