First
the low segments AL and
BL
are added using the
following
program
statement:
1070
CL$=STR$(AL+BL)
IIUlnoer
CL$
= converted = (numeric sum of
AL
+BH)
to string
The sum of AL and
BL
is
converted into numeric string form when assigned
to
CL$.
It
isn't necessary
that
the sum
be
in string form,
but
it
is
much simpler to
test for carry-over using the
LEN
function at line 1080.
Line 1075 truncates the leading blank from the front of
CL$.
Remember that
when a number
is
converted into a string the leading blank
is
included.
We
do
not
want
this leading blank
as
part of CL$ when
we
concatenate the high and low
segments together, therefore
we
truncate
it
with
the
MID$
function.
Line 1080 tests the length of sum CL$ against the segment length
F.
If the
length of CL$
is
greater than
F,
the leftmost
digit
is
carried over and added to the
sum
CH$.
(The value of D
is
equal to either 0 or
1.)
CH$
is
obtained by adding AH,
BH,
and the carry
D.
Statements 1070 to
1090 show the process of adding the high and low numbers to obtain CH$+CL$.
1070
CL$=STR$(AL+BL)
CL$=STR$(jt.6901234561
+
1t.657943572D
CL$=STR$(Jt.6148067028\l
CL$=1161114!sI01617\ü12ls1
1075
CL$=MID$(CL$.2.LEN(CL$)-1)
CL$=MID$(1161114Is!016171012!s\'2.1
0-1)
CL$=MID$(Jt.6!114IsI0!6171012IsI.2.9)
CL$-1114IsI016171012Isl
1080
IF
LEN(CL$»F
THEN
D=1
LEN(CL$)=9 ;F=S
9>S-D=1
1090
CH$=STR$(AH+BH+D)
CH$=STR$(j161234567SI
+
116000000001
+~)
CH$=STR$(J161234567~)
CH$-@1121314151617191
1095
ÇH$=MID.(CH
••
2.LENCCH.)-1)
CH$=MID$@1ï12l314151617191.2.
1o
-
1
)
CH$=MID$qt.6~
12131415161719\.2.9)
CH$-J1J213J41516I7J9!
200