Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 8
Format-Directed Formatting
Formatting Numbers, Text, and Other Data Items
There are several edit descriptors that you can use to process and format data for
output:
The edit descriptors listed above are known as repeatable edit descriptors because the
edit descriptor can be applied repeatedly to several data items in an array pointed to by
the list data element. To repeat an edit descriptor, you enclose the edit descriptor in
parentheses and precede it with a number indicating the number of repetitions. The
following example reserves six character positions on output for a logical data item and
repeats three times:
3(L6)
In this case, the corresponding data descriptor points to an array with at least three
entries in it. The output indicates logical values for the first three values in the array.
For example:
Array values: 27, 6789.3, 0
Output: " T T F"
A Formats ASCII-coded text; the input is usually a string type but could also be
numeric—the binary numbers are interpreted as ASCII characters.
B Converts a number from its internal representation into ASCII code for output as
a binary number according to a specified format.
D Is identical to the E edit descriptor.
E Converts a binary floating-point number into ASCII code for output as a decimal
number according to a specified format.
F Converts a binary fixed-point number into ASCII code for output as a decimal
number according to a specified format.
G Converts a binary fixed-point or floating-point number into ASCII code for output
as a decimal number according to a specified format.
I Converts a binary number into an integer for output according to a specified
format. The output is in ASCII code and can be in any specified numeric base
from 2 to 16, inclusive.
L Processes the input value and returns a true or false indication: “T” if the value
is nonzero, “F” if the value is zero.
M Edits alphanumeric or numeric data according to an editing pattern or mask.
O Converts a number from its internal representation into ASCII code for output as
an octal number according to a specified format.
Z Converts a number from its internal representation into ASCII code for output as
a hexadecimal number according to a specified format.