Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 2
Format-Directed Formatting
The FORMATDATA and FORMATDATAX procedures are also identical except that
FORMATDATA requires that all of its reference parameters be 16-bit addresses, while
FORMATDATAX accepts extended (32-bit) addresses for all of its reference
parameters.
The FORMATCONVERT procedure is used in combination with FORMATDATA, while
the FORMATCONVERTX conversion is used in combination with FORMATDATAX.
The direction of the format conversion—format directed or list directed, input or
output—is determined by the flags parameter passed to the FORMATDATA[X]
procedure.
This subsection does not describe every available edit descriptor, nor does it describe
all aspects of every edit descriptor that it mentions. For complete details on all edit
descriptors, refer to the Guardian Procedure Calls Reference Manual.
Format-Directed Formatting
Format-directed formatting works by providing the FORMATDATA[X] procedure with a
sequence of edit descriptors that specify how data is to be formatted. You specify
format-directed formatting by setting bit 2 of the flags parameter to zero (the default
value) when calling the FORMATDATA[X] procedure.
You can apply a format to output data or input data as follows:
When formatting output, you supply the data to be formatted in an internal form.
The FORMATDATA[X] procedure converts the data into an external form according
to the specified format.
When formatting input, you supply data in external form. The FORMATDATA[X]
procedure converts the input into internal form according to the specified format.
The following paragraphs describe output formatting and input formatting in detail and
di
scuss some of the more common formatting operations.
Note. TNS/R native programs that perform formatting must use FORMATCONVERTX and
FORMATDATAX rather than FORMATCONVERT and FORMATDATA.