Commodore PET User Manual page 232

Table of Contents

Advertisement

Without the zeros to hold the positions. the answers would be aligned incorrectly
as:
Pl 1999800011
P2 1999800011
Incorrect
P3 1999800011
P4 ,
1999800011
instead of:
1999800011
19998000110000
1999800011 0000
Correct
199980001100000000
The number of zeros to be concatenated onto the end of the product strings
is assigned to F$. The constant variable "F" is set to the dividing number. in this
example F
=
4. F$ is assigned the leftmost "F" zeros in ZERO$.
40 ZERO$=" 0000€100e000e000e"
1008 F$=LEFT$(ZERO$,F)
F$=lEFT$(ZERO$,4)
F$=
plolololololololololol
F$="OOOO"
When P1$. P2$. P3$. and P4$ are calculated lIines 1070 through 1100l. the cor-
rect number of zeros are simultaneously concatenated to the end of the string to
align the products correctly. The products are now aligned and ready to be added:
AH 11i191919191
Al 1li19J919191
x BH 11i191919191
Bl 11i191919191
1999800011 Pl
19998000100001 P2
19998000100001 P3
199980001000000001
P4
-.- -.-
F$
F$
279

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents