Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 16
!Set up list elements that point to the above arrays:
VLIST^LEN := 7;
FLAGS := 0;
VLIST[0].ELEMENT^PTR := @MONTH;
VLIST[0].ELEMENT^SCALE := 0;
VLIST[0].ELEMENT^TYPE := 0;
VLIST[0].ELEMENT^LENGTH := 10;
VLIST[0].ELEMENT^OCCURS := 1;
VLIST[1].ELEMENT^PTR := @INT^YEAR;
VLIST[1].ELEMENT^SCALE := 0;
VLIST[1].ELEMENT^TYPE := 2;
VLIST[1].ELEMENT^LENGTH := 2;
VLIST[1].ELEMENT^OCCURS := 2;
VLIST[2].ELEMENT^PTR := @INT^ARRAY1;
VLIST[3].ELEMENT^PTR := @INT^ARRAY2;
VLIST[4].ELEMENT^PTR := @INT^ARRAY3;
VLIST[5].ELEMENT^PTR := @INT^ARRAY4;
I := 2;
WHILE I < VLIST^LEN DO
BEGIN
VLIST[I].ELEMENT^SCALE := 0;
VLIST[I].ELEMENT^TYPE := 2;
VLIST[I].ELEMENT^LENGTH := 2;
VLIST[I].ELEMENT^OCCURS := 7;
I := I + 1;
END;
VLIST[6].ELEMENT^PTR := @INT^ARRAY5;
VLIST[6].ELEMENT^OCCURS := 2;
!Format the data:
ERROR := FORMATDATA(BUFFERS,
BUFFER^LENGTH,
NUM^BUFFERS,
BUFFER^ELEMENTS,
WFORMAT,
VLIST,
VLIST^LEN,
FLAGS);
IF ERROR <> 0 THEN ...
The above code fragment is shown again at the end of this subsection as a complete
program including all data declarations and relevant error checking.
Figure 19-7 shows the function of the above code fragment.