Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
19 - 1
19
Formatting and Manipulating
Character Data
This section describes how to use the character formatting and editing capabilities of
the operating system. Included here are discussions of the following:
How to use the formatter (FORMATCONVERT[X] and FORMATDATA[X]
procedures) for presenting data in an organized way, such as for displaying
tabulated data. Using the Formatter provides details.
How to perform operations on character strings such as changing the case of
alphabetic characters (SHIFTSTRING procedure), converting numeric data
between ASCII representation and binary numbers (NUMIN, NUMOUT, DNUMIN,
and DNUMOUT procedures), editing a character string (FIXSTRING procedure), or
sorting characters (HEAPSORT[X_] procedure). See Manipulating Character
Strings for details.
How to manipulate multibyte character sets such as those used for representing
the Japanese, Chinese, and Korean languages (MBCS_* procedures). See
Programming With Multibyte Character Sets for details.
Using the Formatter
The formatter enables you to arrange lists of data items on output or input. The way
you arrange data can be format-directed or list-directed:
Format-directed formatting arranges data items according to a sequence of edit
descriptors that specify a format. Using the edit descriptors, you can specify how
and where data items are displayed and you can specify the data type; the system
will do any necessary conversion for you (such as converting numeric data into
ASCII). Format-directed formatting is used mostly in formatting data on output to
display it in a readable way.
List-directed formatting does not use a specified format but formats data using
data-type information that is entered as an attribute of the data item. This method
is less powerful than format-directed formatting for arranging data. Its major use is
in interpreting free-format input and then storing that input in a compact form.
This subsection discusses format-directed formatting and list-directed formatting and
describes several of the more common formatting tasks that you can perform.
Specifically, it discusses the FORMATCONVERT[X] and FORMATDATA[X] procedures,
which perform the formatting.
The FORMATCONVERT and FORMATCONVERTX procedures are identical except
that FORMATCONVERT requires that all of its reference parameters be 16-bit
addresses, while FORMATCONVERTX accepts extended (32-bit) addresses for all of
its reference parameters.