beautypg.com

Name objects – AMT Datasouth PAL User Manual

Page 19

background image

Objects

13

In many cases, the programmer will not wish PAL to duplicate the value portion. Duplicating only
the object portion of the string does not consume very much of the printer's memory. On the other
hand, duplicating the value portion of a large string will consume a large amount of the printer's
memory.

PAL accepts strings as text enclosed in parenthesis. For example, "(hello)" specifies a string
consisting of the characters "h," "e," "l," "l," and "o."

PAL also allows the programmer to include parenthesis as part of the string. Strings containing
balanced pairs of parenthesis do not require any special treatment. For example, PAL also accepts
"(ab(cd)ef)" as a perfectly valid string. In this case, the string contains eight characters —
"ab(cd)ef."

If the string contains unbalanced parenthesis, then the programmer should place the special back-
slash (\) character in front of each parenthesis. The programmer may also use a back-slash even
when the string contains balanced parenthesis. A computer program which generates the strings to
send to a PAL printer would normally just place a back-slash in front of every parenthesis.
Therefore, the programmer could also specify the preceeding string as "(ab\(cd\)ef."

In order to include the back-slash as part of a string, the programmer need only specify two back-
slashes. For example, specifying "(The back-slash character \(\\\) is a prefix!)" creates the
string "The back-slash character (\) is a prefix!"

The following table list all the special characters which the programmer can place into strings
using the back-slash character.

PAL
Code

Description

ASCII
Symbol

Octal
Value

Hexadecimal
Value

\n

New Line

LF

012

0A

\r

Carriage Return

CR

015

0D

\t

Tab

HT

011

09

\b

Backspace

BS

010

08

\f

Form-Feed

FF

014

0C

\\

Back-Slash

\

134

5C

\(

Left (Open) Parenthesis

(

050

28

\)

Right (Close) Parenthesis

)

051

29

\ddd

Character for Octal Code ddd

any

ddd

3.1.5.

Name Objects

Just like strings, names consist of a variable length collection of bytes. In simple applications, each
byte usually represents a printable character. A name can contain from one to 30,000 bytes.

Since each name can have a variable number of bytes associated with it, PAL stores a name object
in exactly the same manner as it stores string objects. In fact, PAL treats name objects and string
objects in an almost identical manner.

Each name objects has one of three different attributes — executable, literal, or immediate
evaluation
. The programmer specifies which attribute the name object should have by placing
zero, one, or two forward slashes (/) immediately in front of the name.

If the programmer does not place any forward slash in front of the name, PAL treats the name as
executable. For example, PAL will treat the character sequence "MyName" as an executable
name. Provided PAL does not encounter the name while creating a procedure, PAL will try to find