Guardian Programmer's Guide

Table Of Contents
Formatting and Manipulating Character Data
Guardian Programmer’s Guide 421922-014
19 - 7
Format-Directed Formatting
Several examples of common uses of edit descriptors are given throughout the
remainder of this subsection. For a description of every edit descriptor, modifier, and
decoration, see the Guardian Procedure Calls Reference Manual.
Introduction to Data Descriptors
Each data descriptor describes an internal data item as shown in Figure 19-3:
The data pointer points to the item of data. The data pointer is one word if the data
item is in the user data segment or two words if the data item is in an extended data
segment.
The scale factor is one byte long and is normally zero, but it can adjust the position of
the implied decimal point: a positive value moves the implied decimal point to the right;
a negative number moves it to the left.
The data type is also one byte long and indicates the type of data that the data item
contains; for example, the data type for a string is 0 and the data type for a signed
integer is 2. For a complete list of data types, see the FORMATDATA[X] procedure in
the Guardian Procedure Calls Reference Manual.
The subelement length gives the length in bytes of each element in the data item. For
example, if the corresponding edit descriptor specifies a six-character text item, then
the subelement length is 6.
The number of occurrences indicates the number of repetitions of the element in the
data item. For example, if the corresponding edit descriptor specifies a six-character
text item repeated 10 times, then the number of occurrences is 10. In this case, the
actual length of the data item is 60 characters.
The null pointer is the byte address of the null value if used. If the data item is in the
user data segment, then this value is one word in length. If the data item is in an
extended data segment, then this value is two words long.
Figure 19-3. Contents of a Data Descriptor
VST096.VSD