IBM 1130 User Manual page 552

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Other Character Handling Techniques
Editing Output--EDIT
Most commercial applications are strongly oriented
toward the format and appearance of the output re-
sults, as opposed to the technical job, where all
you want is the answer.
For example:
Dollar amounts should have commas, dollar
signs, and so on.
Invoices should show a CR symbol after neg-
ative values.
Balance sheets should have a minus sign fol-
lowing a negative item.
Punched card output should have leading zeros,
so that the cards may be handled properly with a
mechanical sorter.
The EDIT subroutine enables you to do all these
formatting tasks. Its use requires two fields,
stored in Al format in integer arrays:
1.
The source field or the field which will be
edited
2.
The edit mask, a field which you have coded
to indicate how you want the edited output to appear.
A typical call to the EDIT subroutine is
CALL EDIT (KSOUR, 1, 10, MASK, 1, 13)
where the source field consists of items 1-10
in
the
KSOURarray, and the mask consists of items 1-13 in
the MASK array. After editing, the MASK field is
replaced by the edited source field; if you wish to
use it again, therefore, you must save it some-
where else. Usually, the mask will be moved into
the output area, and the source field will be edited
into the output array.
Thus the original mask is
not destroyed.
For example:
CALL MOVE (MASK, 1,13, KOUT, 36)
CALL EDIT (KSOUR, 1,10, KOUT, 36,48)
Figure 70.24 is a worksheet that you
may
use
for setting up an edit mask.
The principles in-
volved are shown best by examples (see Figures
70.25-70.30).
Section
Subsections
Page
70
40
I
20
01
Moving Data Fields --MOVE
Often it becomes necessary to move the data
in
one
array into another array--especially if you are
using CSP. The MOVE subroutine has been in-
cluded in CSP to facilitate such operations. Its use
is quite simple, since it does no more than move
. data from one place to another.
For example:
CALL MOVE (IFROM, 6,8, ITO, 14)
will move
IFROM (6) to ITO (14)
IFROM (7) to ITO (15)
IFROM (8) to ITO (16)
leaving the IFROM array undisturbed.
Note that the ending position in the ITO array is
not supplied
-as.
one of the parameters.
The format of the data items is not affected.
They may be AI, A2, decimal, or integer (but not
real).

Advertisement

Table of Contents
loading

Table of Contents