Category : Word Processors
Archive   : PTRHELP.ZIP
Filename : WPDL.DOC

 
Output of file : WPDL.DOC contained in archive : PTRHELP.ZIP
ÿWPCz
ûÿ2ö B
T_;³îTimes Roman 10 pitch (PC-8)ÿÿ…1\E-°W•ô\@pÐPÿÂÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPostScript - LPT1PS.PRSôðk£LNûÿ2D( ©ÿÿTµÿÿ; "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ^- «xà‚Ð Ő3Ø'3Ø'Standard3Ø'3Ø'StandardPS.PRSàÅ ÐÐ °°X° ÐÕI·°dà ÃWordPerfect Corp. ConfidentialÄ ÄÁà-ì5ÁPage IÕÁàì8Áà ÃWPDL DocumentationÄ Äƒ

ÃÃLanguage OverviewÄÄ

WPDL is WordPerfect Corporation's acronym for à ÃWordPerfect Printer Definition LanguageÄ Ä. It is a
powerful and flexible method of sending codes to a printer and providing information for WordPerfect
to use in determining how to print the document.

WPDL expressions are used in WP 5.0 printer definitions for all printer definition strings, sheet
feeder definition strings, and character mapping strings. A WPDL expression can consist of
characters to be sent to the printer, or numerical expressions which are calculated and the result sent
back to WordPerfect, or both. An example of a numerical expression would be the WPDL
expression asking for à ÃMaximum HMI UnitsÄ Ä. Obviously this should not send anything to the printer
but would simply consist of a number that would be sent back to WordPerfect to use in calculating
how to print the line. On the other hand the WPDL expression for à ÃSet HMIÄ Ä would send a string to
the printer but would not return any value to WordPerfect. An expression could both send a string to
the printer and return a value to WordPerfect, but this would be extremely unusual.

If more than one numerical value is calculated in a WPDL expression then only the result of the last
one is sent back to WordPerfect. Character strings on the other hand are immediately sent to the
printer whenever they are encountered and there can be as many strings in the expression as desired.
If a character string to be sent to the printer follows the last numerical expression the result of the
numerical expression will still be sent back to WordPerfect.


ÃÃCharacter StringsÄÄ

Character strings consist of one or more bytes to be sent to the printer. They can be entered by their
decimal, hexadecimal, octal, or binary values, or by their character or ASCII text representations.
Examples of these methods are as follows:

Decimal Representation:Á&.ÁÁ.h5Á[27,30,13]

Hexadecimal Representation:Á*.ÁÁ.h5Á<1b,1e,0d>

Octal Representation:Á$¸ &ÁÁ&.ÁÁ.h5Á:33,36,15:

Binary Representation:Á%¸ &ÁÁ&.ÁÁ.h5Á/11011,11110,1101/

Character Representation:Á(.ÁÁ.h5Á"ABCDEFG"

ASCII Text Representation:Á).ÁÁ.h5ÁBEGINTEXT
ÁÁÁ` ÁÁ¸ &ÁÁ&.Á¸ .h5ÂThis is a sample of the ASCII text representation. All text
between the BEGINTEXT and ENDTEXT commands is sent
to the printer unchanged. Newlines in this region are sent as
linefeeds ([10]'s). The BEGINTEXT and ENDTEXT
commands must be placed on lines by themselves or they are
treated as part of the text. This representation is particularly
useful in controlling PostScript devices.Æ(#hÆ
ÁÁÁ` ÁÁ¸ &ÁÁ&.ÁÁ.h5ÁENDTEXT

Only byte values from 32 to 126 can be entered with character representations. The ASCII text
representation supports ASCII codes from 0 to 127. All other character values must be represented in
decimal, octal, hex, or binary.
ÃÃ
Ô
'Ô WPDL Numerical ExpressionsÄÄ

Operands in a numerical expression can be constants, built©in WPDL variables, or user©defined
variables. Constants in numerical expressions can be entered in decimal, hexadecimal, octal, binary,
or character form. Examples of the constants 10, 40, and 100 are as follows:

Decimal:Á` ÁÁ¸ &Á10Á(.ÁÁ.h5Á40Á7À=ÁÁ=EÁ100
Hexadecimal:Á` ÁÁ¸ &Á0ahÁ).ÁÁ.h5Á28hÁ8À=ÁÁ=EÁ64h
Octal:ÁÁÁ` ÁÁ¸ &Á12qÁ).ÁÁ.h5Á50qÁ8À=ÁÁ=EÁ144q
Binary:ÁÁÁ` ÁÁ¸ &Á1010bÁ+.ÁÁ.h5Á101000bÁ<EÁ1100100b
Character:Á` ÁÁ¸ &Án/aÁ).ÁÁ.h5Á '(,'Á:À=ÁÁ=EÁ'd'

Note that character constants (numbers) in numerical expressions are entered in single quotes, whereas
character strings to be sent to the printer are entered in double quotes.
ÃÃ

Variables
ÄÄ
Following is a complete list of WPDL built©in variables and their meanings:

HUNITSÁ` ÁÁ¸ &ÁHorizontal movement units in the current font
HUNITSNÁ` ÁÁ¸ &ÁNumerator of horizontal movement units
VUNITSÁ` Á¸ &ÂVertical movement units (same for all fonts)Æ(#¸ Æ
VUNITSNÁ` ÁÁ¸ &ÁNumerator of vertical movement units
WUNITSÁ` ÁÁ¸ &ÁCharacter width units in the current font (usually same as HUNITS)
XPOSÁÁÁ` ÁÁ¸ &ÁCurrent horizontal position in HUNITS
YPOSÁÁÁ` ÁÁ¸ &ÁCurrent vertical position in VUNITS
PITCHÁÁÁ` Á¸ &ÂCharacter spacing in HUNITSÆ(#¸ Æ
PTSIZEÁÁÁ` Á¸ &ÂCurrent font point size in 3600ths of an inchÆ(#¸ Æ
HSÁÁÁ` ÁÁ¸ &ÁCurrent horizontal spacing (for Set HMI or Horizontal Microspace commands)
VSÁÁÁ` ÁÁ¸ &ÁCurrent vertical spacing (for Set VMI or Vertical Spacing commands)
WEIGHTÁ` ÁÁ¸ &ÁCurrent font weight (0=extra light, 1=light, 2=normal, 3=bold, 4=extra bold)
SLANTÁÁÁ` Á¸ &ÂSlant of the current font in 1200thsÆ(#¸ Æ
QUALITYÁ` ÁÁ¸ &ÁPrint quality (0=draft, 1=medium, 2=high)
NOMWIDTHÁ` ÁÁ¸ &ÁNominal character width of the current font in 1200ths
CURWIDTHÁ` ÁÁ¸ &ÁWidth of current character in WUNITS (only used in character map strings)
CAPHEIGHTÁ` ÁÁ¸ &ÁCap height of current font in 1200ths
XHEIGHTÁ` ÁÁ¸ &ÁX height of current font in 1200ths
DHEIGHTÁ` ÁÁ¸ &ÁDescender height of current font in 1200ths
CHARSETÁ` ÁÁ¸ &ÁCharacter set number of the current font
REMÁÁÁ` ÁÁ¸ &ÁRemainder of the last divide operation
YESÁÁÁ` ÁÁ¸ &ÁAlways has a value of 1
NOÁÁÁ` ÁÁ¸ &ÁAlways has a value of 0
BINÁÁÁ` ÁÁ¸ &ÁBin number currently in use
ORIENTATIONÁ¸ &ÁOrientation of the current font
RESOURCEÁ` ÁÁ¸ &ÁResource id of the resource used by the current font/group
PAGEÁÁÁ` ÁÁ¸ &ÁPhysical page # of the current print job
COPIESÁ` ÁÁ¸ &ÁNumber of copies to be printed
FNTNUMÁ` ÁÁ¸ &ÁUnique font # for each font, 0-1500
GRPNUMÁ` ÁÁ¸ &ÁUnique group # for each group, 0-1500
PAPERSIZEÁ` ÁÁ¸ &ÁPaper size type
PAPERWIDTHÁ` Á¸ &ÂWidth of paper in 1200thsÆ(#¸ Æ
PAPERLENGTHÁ¸ &ÁLength of paper in 1200ths
OUTLINEÁ` ÁÁ¸ &ÁHas a value of one if outline is on
ITALICSÁ` ÁÁ¸ &ÁHas a value of one if italics is on
SHADOWÁ` ÁÁ¸ &ÁHas a value of one if shadow is on
REDLINEÁ` ÁÁ¸ &ÁHas a value of one if redline is on
DUNDERLINEÁ` Á¸ &ÂHas a value of one if double underline is onÆ(#¸ Æ
BOLDÁÁÁ` ÁÁ¸ &ÁHas a value of one if bold is on
STRIKEOUTÁ` ÁÁ¸ &ÁHas a value of one if strikeout is onÔ
ò)ԌUNDERLINEÁ` ÁÁ¸ &ÁHas a value of one if underline is on
COLORÁ` ÁÁ¸ &ÁPrinter's id for color
REDÁÁÁ` ÁÁ¸ &ÁRed value of rgb
GREENÁ` ÁÁ¸ &ÁGreen value of rgb
BLUEÁÁÁ` ÁÁ¸ &ÁBlue value of rgb
GRAPHICSÁ` ÁÁ¸ &ÁGraphics are being printed? (1=yes, 0=no)
GRAPHCOUNTÁ¸ &ÁWidth of a graphics object in bytes
GRAPHHEIGHTÁ¸ &ÁHeight of a graphic object in device resolution units
GRAPHWIDTHÁ¸ &ÁWidth of a graphic object in device resolution units
GRAPHDENSITYÁ¸ &ÁPrinter's id for graphics resolution
GRAYSCALEÁ` ÁÁ¸ &ÁGray level intensity for a shaded box
XRESOLUTIONÁ¸ &ÁCurrent x resolution
YRESOLUTIONÁ¸ &ÁCurrent y resolution


ÃÃÔ
ª
Ô Arithmetic OperatorsÄÄ

Arithmetic operators closely follow those of the C programming language. They are as follows:

ÃÃOperatorÁ` ÁÁ¸ &ÁNameÁ*.ÁÁ.h5ÁÁ5À=ÁÁ=EÁPrecedenceÁOÈTÁBindingÄÄ

©ÁÁÁ` ÁÁ¸ &ÁnegateÁ,.ÁÁ.h5ÁÁ5À=ÁÁ=EÁ12ÁGpLÁÁLÈTÁR © L
~ÁÁÁ` ÁÁ¸ &Ábitwise notÁ1h5ÁÁ5À=ÁÁ=EÁ12ÁGpLÁÁLÈTÁR © L
!ÁÁÁ` ÁÁ¸ &Álogical notÁ1h5ÁÁ5À=ÁÁ=EÁ12ÁGpLÁÁLÈTÁR © L
*ÁÁÁ` ÁÁ¸ &ÁmultiplyÁ.h5ÁÁ5À=ÁÁ=EÁ11ÁGpLÁÁLÈTÁL © R
/ÁÁÁ` ÁÁ¸ &ÁdivideÁ,.ÁÁ.h5ÁÁ5À=ÁÁ=EÁ11ÁGpLÁÁLÈTÁL © R
//ÁÁÁ` ÁÁ¸ &Ádivide and roundÁ6À=ÁÁ=EÁ11ÁGpLÁÁLÈTÁL © R
%ÁÁÁ` ÁÁ¸ &ÁmoduloÁ,.ÁÁ.h5ÁÁ5À=ÁÁ=EÁ11ÁGpLÁÁLÈTÁL © R
+ÁÁÁ` ÁÁ¸ &ÁaddÁ).ÁÁ.h5ÁÁ5À=ÁÁ=EÁ10ÁGpLÁÁLÈTÁL © R
©ÁÁÁ` ÁÁ¸ &ÁsubtractÁ..ÁÁ.h5ÁÁ5À=ÁÁ=EÁ10ÁGpLÁÁLÈTÁL © R
<<ÁÁÁ` ÁÁ¸ &Áshift leftÁ0h5ÁÁ5À=ÁÁ=EÁ9ÁFpLÁÁLÈTÁL © R
>>ÁÁÁ` ÁÁ¸ &Áshift rightÁ1h5ÁÁ5À=ÁÁ=EÁ9ÁFpLÁÁLÈTÁL © R
<ÁÁÁ` ÁÁ¸ &Áless thanÁ/h5ÁÁ5À=ÁÁ=EÁ8ÁFpLÁÁLÈTÁL © R
<=ÁÁÁ` ÁÁ¸ &Áless than or equalÁ8À=ÁÁ=EÁ8ÁFpLÁÁLÈTÁL © R
>ÁÁÁ` ÁÁ¸ &Ágreater thanÁ2h5ÁÁ5À=ÁÁ=EÁ8ÁFpLÁÁLÈTÁL © R
>=ÁÁÁ` ÁÁ¸ &Ágreater than or equalÁ;À=ÁÁ=EÁ8ÁFpLÁÁLÈTÁL © R
==ÁÁÁ` ÁÁ¸ &ÁequalÁ+.ÁÁ.h5ÁÁ5À=ÁÁ=EÁ7ÁFpLÁÁLÈTÁL © R
!=ÁÁÁ` ÁÁ¸ &Ánot equalÁ/h5ÁÁ5À=ÁÁ=EÁ7ÁFpLÁÁLÈTÁL © R
&ÁÁÁ` ÁÁ¸ &Ábitwise andÁ1h5ÁÁ5À=ÁÁ=EÁ6ÁFpLÁÁLÈTÁL © R
|ÁÁÁ` ÁÁ¸ &Ábitwise orÁ0h5ÁÁ5À=ÁÁ=EÁ5ÁFpLÁÁLÈTÁL © R
^ÁÁÁ` ÁÁ¸ &Ábitwise xorÁ1h5ÁÁ5À=ÁÁ=EÁ4ÁFpLÁÁLÈTÁL © R
&&ÁÁÁ` ÁÁ¸ &Álogical andÁ1h5ÁÁ5À=ÁÁ=EÁ3ÁFpLÁÁLÈTÁL © R
||ÁÁÁ` ÁÁ¸ &Álogical orÁ0h5ÁÁ5À=ÁÁ=EÁ2ÁFpLÁÁLÈTÁL © R
:=ÁÁÁ` ÁÁ¸ &ÁassignmentÁ0h5ÁÁ5À=ÁÁ=EÁ1ÁFpLÁÁLÈTÁR © L
+=ÁÁÁ` ÁÁ¸ &Áadd and assignÁ4h5ÁÁ5À=ÁÁ=EÁ1ÁFpLÁÁLÈTÁR © L
©=ÁÁÁ` ÁÁ¸ &Ásubtract and assignÁ9À=ÁÁ=EÁ1ÁFpLÁÁLÈTÁR © L

Precedence indicates which operations occur first. In the expression à ÃA := B + C * D Ä Äthe
multiplication will occur first because it has the highest precedence. The addition will occur next and
the assignment will occur last because it has the lowest precedence.

The binding indicates which operation will occur first when two operators have the same precedence.
In the expression à ÃA := B := C * D * E Ä Äthe multiplication of à ÃCÄ Ä and à ÃDÄ Ä would occur before the
multiplication of à ÃDÄ Ä and à ÃEÄ Ä because the precedence of the multiplication operators are the same and
they have left to right binding. On the other hand the assignment of the value of the value
à ÃC * D * E Ä Äto the variable à ÃBÄ Ä would occur before the assignment to the variable à ÃAÄ Ä because the
assignment operators have right to left binding, meaning that the rightmost operation happens first
with multiple assignment operators.

Parentheses may be used in order to alter the operator precedence in specific circumstances. All
operators inside of a pair of parentheses have higher precedence than those outside the parentheses.
In the example expression à ÃA := B + C * D Ä Äthe multiplication would normally occur first. If you
wish to force the addition to occur first parentheses may be used to alter the precedence values as in
the following example: Ã ÃA := (B + C) * DÄ Ä

A space or blank line must be used to separate one expression from another. They may also be used
anywhere to improve the readability of an expression. They are always ignored.


ÃÃWPDL Variable PrecisionÄÄ

All WPDL variables whether built©in or user©defined are signed double words. This means they can
take on values from -2,147,483,648 to 2,147,483,647.

Ô
ò)Ô ÃÃString Output FunctionsÄÄ

Numerical values can be calculated and sent to the printer in Binary or ASCII format. This is
necessary in many WPDL expressions, such as à ÃSET HMIÄ Ä. The string output functions are:

SENDHI(var)Á` Á¸ &ÂSends the high byte of the low word of a variable in binary formÆ(#¸ Æ
SENDLO(var)Á` Á¸ &ÂSends the low byte of the low word of a variable in binary formÆ(#¸ Æ
SENDHILO(var)Á¸ &ÁSends the high, then low bytes of the low word in binary form
SENDLOHI(var)Á¸ &ÁSends the low, then high bytes of the low word in binary form
DOWNLOAD(file)¸ &ÂSends a file to the printer. Only a filename is specified here. The path will
come from information entered by the user at printer selection time.Æ(#¸ Æ
ASCII(expr,count)Â ¸ &ÂSends the value of expr to the printer in ASCII form. If count is present then
leading zeros are forced onto the result until the result uses count digits. If
count is omitted then no leading zeros will be used. If the value is negative a
'©' sign will be sent before the number. The minus sign is not included in the
digit count if a count is specified.Æ(#¸ Æ


The à ÃSet HMIÄ Ä string for a Diablo printer would be: à Ã[27,31] LO(HS+1)Ä Ä. The à Ã[27,31]Ä Ä corresponds to
the à Ã<27><31>Ä Ä of the 4.2 definition and the à ÃLO(HS+1)Ä Ä corresponds to the à ÃÄ Ä. The à ÃHSÄ Ä is the
WPDL built©in variable that always contains the value to be used for the setting the HMI. The
constant one that is added to à ÃHSÄ Ä accounts for the BIAS FACTOR of one that the Diablo uses.


ÃÃNumeric FunctionsÄÄ

Numeric functions are like string output functions, except that they return a value to be used in a
numerical expression rather than causing output to be sent to the printer. There are:

CONVERT(value,oldunits,newunits)¸ /h5Âconverts a value from one set of units to another.Æ(#hÆ
CHRWID(char#)Á¸ &ÁÁ&.ÁÁ.h5Ágets the character width for char# in the current font.

An example of numeric functions in use is: Ã ÃAB := CHRWID('A') + CHRWID('B')Ä Ä
ÙÙ

ÃÃOther OperatorsÄÄ

REPOSITIONÁ` ÁÁ¸ &ÁÂ` &.ÂCauses the printer to reposition to the current horizontal location.
This is the equivelent of the old code.Æ(#Æ
; (semicolon)Á` ÁÁ¸ &ÁÂ` &.ÂText between a semicolon and the end of a line is treated as a
comment field and is ignored.Æ(#Æ
PROMPT("message")Á ¸ &ÁÂ` &.ÂCauses "message" to be output on the status line in printer control.Æ(#Æ
BEEPÁÁÁ` ÁÁ¸ &ÁÂ` &.ÂCauses WP to emit a beep to signal the user that there is a message
in printer control.Æ(#Æ
WAITÁÁÁ` ÁÁ¸ &ÁÁ&.ÁCauses WP to pause and wait for a GO in printer control.


ÃÃÔ
™!Ô Conditional Expression ExecutionÄÄ

WPDL allows conditional execution of expressions. The condition operators are as follows:

IF (expr)Á` Á¸ &ÂEvaluates expr to TRUE or FALSE. If the result is TRUE then execution
continues until an ELSE or ELSEIF is found at which point it skips to the
ENDIF. If expr is FALSE then execution skips to the ELSE or ELSEIF and
continues from there. The ELSE and ELSEIF are optional and if not present
execution will skip from the IF to the ENDIF if expr is FALSE.Æ(#¸ Æ
ELSEÁÁÁ` Á¸ &ÂOptional operator to separate the code executed if expr is TRUE from the
code executed if expr is FALSE.Æ(#¸ Æ
ENDIFÁÁ°` ÂÂX¸ &ÂEnds the IF conditional.Æ(#¸ Æ
ELSEIF (expr)°` ÂÂX¸ &ÂA combination of an ELSE immediately followed by an IF. If the expr from
the prior IF or ELSEIF was FALSE then the expr following the ELSEIF is
evaluated. If this new expr is TRUE execution continues. If the new expr is
FALSE then execution will skip to the next ELSE, ELSEIF, or ENDIF.Æ(#¸ Æ
WHILE (expr)°` ÂÂX¸ &ÂEvaluates expr and jumps to ENDWHILE if expr is FALSE.Æ(#¸ Æ
ENDWHILEÁ` Á¸ &ÂLoops back to the WHILE to reevaluate expr.Æ(#¸ Æ

The logical and comparison numerical operators always return a value of 1 if the operation is TRUE
or 0 if the operation is FALSE. Any non©zero value is always considered TRUE in WPDL
conditionals and a zero value is always considered FALSE.

Following are some examples of how the conditional operators are used:
ÒÆ°À(#Æ҇
à ÃIF(abc==25)
"the value of abc is 25"
ELSE
"abc is " ascii(abc)
ENDIF

n:=1
WHILE(n<=10)
"the value of n is " ascii(n) [13,10]
n+=1
ENDWHILEÄ Ä
Ô
¼Ô
à ÃIF(fred<10)
"fred is a single digit"
ELSEIF(fred<100)
"fred is two digits"
ELSEIF(fred<1000)
"fred is three digits"
ELSE
"fred is four or more digits"
ENDIFÄ Ä


  3 Responses to “Category : Word Processors
Archive   : PTRHELP.ZIP
Filename : WPDL.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/