This month our P & R for the ZX-81/1000 is from ZX COMPUTING. We hope that you enjoy them. The 2068 program this time comes to us from THE TIMEX SINCLAIR 2068 EXPLORED by TIM HARTNELL. The last 2068 program, SMALL TOOL, is from VINCE LYON. It is a HEX/BIN CONVERSION routine. If you have any questions contact VINCE for help. We hope that we have put in something for everyone. ENJOY!!!
A useful little program to turn your computer into an adding machine, but what is special is the routine to align the decimals.
This can be utilised for any program which requires figure work involving decimals.
Another tip from Mervin is that you can economise when using this program by turning the printer paper around and re-using it.
1 REM "ADDING MACHINE"
2 GOTO 60
3 LET B=0
6 IF E=0 THEN GOTO 21
9 LET B=INT (LN (ABS E)/LN 10)
12 IF 1>ABS E AND ABS E>0 THEN LET B=0
15 IF .1>ABS E AND ABS E>=.01 THEN LET B=-1
18 IF E<0 THEN LET B=B+1
20 IF E$="" THEN LPRINT TAB 21-B;"TOTAL"
21 IF E=INT E THEN LPRINT TAB 28-B;E;".00"
23 IF E=INT E THEN RETURN
25 LET W=10*E-INT ((E*10)+.5)
27 IF -1E-8<W AND W<1E-8 THEN LPRINT TAB 28-B;E;"0"
29 IF -1E-8<W AND W<1E-8 THEN RETURN
31 LPRINT TAB 28-B;E
33 RETURN
60 LET W=0
70 LET E=0
80 LET T=0
100 INPUT E$
120 IF E$="" THEN LET E=T
130 IF E$="" THEN GOSUB 3
140 LET E=VAL E$
150 LET T=T+E
200 GOSUB 3
300 GOTO 100
Transcription note: the listing is corrected. As printed, line 15 reads ABS E>=1, so it can never be true and amounts from .01 to .099 print one column out of line; corrected to ABS E>=.01.
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.