8-Bit Software Online Conversion
Spreadsheet - Listing
5 IF ?&2420<>169 THEN *LOAD"SC`MC"
10 MODE 4
15 VDU23,1,0;0;0;0;0;
25 *KEY10"OLD |M"
30 VDU28,0,27,39,21
35 VDU24,0;130;1279;860;
40 CLS
45
50 REM DEFAULT DECIMAL PLACES
55 ?&8B=4:CLS
60
65 PRINT"CHANGE CALC FORMAT ?"
70 A=GET:IF A<>13 THEN GOSUB 595
75 CLS
76
77 REM CALL &2506 SET&CLEAR BEFORE EN
TRY
78 REM THIS MAY BE REMOVED TO SAFE GU
ARD DATA ON RESTARTING
79 REM IF SO THEN THE MEMORY MUST BE
INITIALISED WITH THE ½R OPTION
80 REM FIRST TIME ROUND ONLY
81
83 CALL &2506
84
85 *FX4,1
90 CALL &2420
95 *FX4,0
100
105 PRINTTAB(0,5)"Calculating ";
110 CALL &2AF4:CALL &2DA8
115 IF ?&8A THEN 150 ELSE 125
120
125 FOR X=1 TO 15
130 FOR Y=1 TO 30
135 GOSUB 190
140 NEXT:NEXT:GOTO 175
145
150 FOR Y=1 TO 30
155 FOR X=1 TO 15
160 GOSUB 190
165 NEXT:NEXT
170
175 CALL &2B01
180 ?1083=-1:GOTO 85
185
190 ?1115=X:?1114=Y:A$=""
195 ?1083=0
200 CALL &2BCA
205 GOSUB 415:GOSUB 220
210 RETURN
215
220 IF A$="" THEN RETURN
225 IF VAL(A$)<>0 THEN RETURN
230 IF LEN(A$)=1 THEN RETURN
235 IF INSTR(A$,CHR$(34)) THEN RETURN
240 IF INSTR(A$,CHR$(39)) THEN RETURN
245 D$=A$:Len=LEN(A$)
250 IF INSTR(A$,"SUM") THEN 525
255 C%=0:N1=0:N2=0
260 GOSUB 455
265 GOSUB 380
270 N1=VAL(A$)
275 REPEAT
280 S$=MID$(D$,1,1)
285 GOSUB 455
290 GOSUB 380
295 N2=VAL(A$)
300 A=INSTR("+-*/^%",S$)
305 ON A GOSUB 475,480,485,490,495,500
310 N2=0
315 UNTIL Len<1
320
325 ?1115=X:?1114=Y
330 S$=STR$(N1)
335 C%=INSTR(S$,".")
340 IF C% THEN GOSUB 510
345 GOSUB 395:CALL &2F8F
350 FOR N=1 TO LEN(S$)
355 ?(N+&0C60)=ASC(MID$(S$,N,1))
360 NEXT
365 ?&78=LEN(S$):?1083=-1
370 CALL &2960:RETURN
375
380 ?1115=ASC(Q$)-64:GOSUB 440
385 ?1114=VAL(D$):GOSUB 440
390 IF ?1114>9 THEN GOSUB 440
395 A$="":?1083=-1
400 CALL &2BCA:GOSUB 415
405 RETURN
410
415 IF ?&75=0 THEN RETURN
420 FOR N=1 TO ?&75
425 A$=A$+CHR$(?(N+&0C30))
430 NEXT:RETURN
435
440 C%=C%+1:D$=MID$(D$,C%)
445 Len=LEN(D$):C%=1:RETURN
450
455 REPEAT
460 C%=C%+1:Q$=MID$(D$,C%,1)
465 UNTIL Q$>"@":RETURN
470
475 N1=N1+N2:RETURN
480 N1=N1-N2:RETURN
485 N1=N1*N2:RETURN
490 N1=N1/N2:RETURN
495 N1=N1^N2:RETURN
500 N1=N1/100*N2:RETURN
505
510 IF INSTR(S$,"E") THEN RETURN
515 S$=MID$(S$,1,C%+?&8B):RETURN
520
525 C%=INSTR(D$,"SUM")+2
530 GOSUB 455:GOSUB 380
535 FC=?1115:FR=?1114
540 GOSUB 455:GOSUB 380
545 TC=?1115:TR=?1114:N1=0
550 FOR R=FR TO TR
555 FOR C=FC TO TC
560 ?1115=C:?1114=R:N2=0
565 GOSUB 395
570 N2=VAL(A$)
575 N1=N1+N2
580 NEXT:NEXT
585 GOTO 325
590
595 CLS:PRINT:PRINT"FORMAT:":PRINT
600 PRINT"1 CALCULATE ";
605 IF ?&8A THEN PRINT"ROWS"; ELSE PRI
NT"COLUMNS";
610 PRINT" FIRST "
615 PRINT
620 PRINT"2 DECIMAL PLACES= ";?&8B
625 A=GET
630 IF A=13 THEN RETURN
635 IF A=50 THEN 655
640 IF A<>49 THEN 625
645 IF ?&8A THEN ?&8A=0 ELSE ?&8A=&FF
650 GOTO 595
655 IF ?&8B=6 THEN ?&8B=1 ELSE ?&8B=?&
8B+1
660 GOTO 595
665
670 END