Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 15
Tabulating Data
You can tabulate data by including tabulation edit descriptors in the edit-descriptor
string. Any of the following are valid forms of tabulation descriptor:
Each of these edit descriptors alters the current position but has no other effect.
The following example enhances the previous example by adding a line at the
beginning of the output to include the name of the month in the middle of the line and
the year number at the beginning and end of the line. The example uses tabulation
descriptors to accomplish this. Note that the example also uses tabulation descriptors
to locate each day of the week in the third buffer.
!Set up the edit descriptors and convert to internal form:
EFORMAT ':=' ["TR17,A8,TL22,2(I4,TR28),//,",
"TR3,'SUN',TR2,'MON',TR2,'TUE',TR2,'WED',",
"TR2,'THU',TR2,'FRI',TR2,'SAT'//,",
"7(I5)//7(I5)//7(I5)//7(I5)//7(I5)"];
SCALES := 0;
CONVERSION := 1;
ERROR := FORMATCONVERT(IFORMAT,
IFORMATLEN,
EFORMAT,
EFORMATLEN,
SCALES,
SCALE^COUNT,
CONVERSION);
IF ERROR <= 0 THEN ...
!Set up arrays for month, year, and date values:
MONTH ':=' "APRIL";
INT^YEAR ':=' [1990,1990];
INT^ARRAY1 ':=' [1,2,3,4,5,6,7];
INT^ARRAY2 ':=' [8,9,10,11,12,13,14];
INT^ARRAY3 ':=' [15,16,17,18,19,20,21];
INT^ARRAY4 ':=' [22,23,24,25,26,27,28];
INT^ARRAY5 ':=' [29,30];
Tn Transmission of a character to or from a buffer is to occur at the nth
character position in the buffer. The first character in the buffer is numbered
1.
TLn Transmission of the next character to or from a buffer is to occur at n
character positions to the left of the current position.
TRn Transmission of the next character to or from a buffer is to occur at n
character positions to the right of the current position.
nX This edit descriptor is identical to TRn.