Correction for JOS

Drawing of the Sinclair QL keyboard
Drawing of the Sinclair QL keyboard

After trying to run my JOS program which was presented in the Jan/Feb ’87 issue of TDM (when you tried to use the LD, LRUN, or DS commands), the program most likely stopped with a mysterious error report–“not implemented”. The error number is 19, which happens to be listed on page 19 of the Concepts section of the QL Users Guide, but there is no reference to what it means. Apparently the MERGE and MRUN commands cannot be called from inside a procedure.

The problem is that I left one line out of the listing. My sincerest apologies to you for any inconvenience caused by mistake. The new listing I have included not only has the “not implemented” bug fix, but a NEW command as well (which I stated in the last article would not work). It works now.

20000 PRINT "Hit S to stop, I for ICE, or any other to run JOS"
20010 ink$=INKEY$(-1)
20020 IF ink$=="s" THEN STOP
20030 IF ink$=="i" THEN ICE
20040 WHEN ERRor :IF ERNUM=-19 THEN CONTINUE: END WHEN
20050 cc:CSIZE 2,1:PRINT " *** JOS ACTIVE ***"
20060 PRINT "©1986 by JOE NEWMAN"
20070 CSIZE 0,0:PRINT "Enter year or ENTER to quit":CSIZE 3,1:INPUT "year (yy) ",year$:IF CODE(year$)<>0 THEN year=year$: INPUT "month",month:INPUT "day",day:INPUT "hour",hr:INPUT "Min.",min:year="19"&year:SDATE year,month,day,hr,min,0
20080 CSIZE 0,0:BEEP 0,1,255,1300,1
20090 drive$="flp1_"
20100 PAUSE 50:BEEP:PRINT "hit > i)ce or b)asic"
20110 ink$=INKEY$(-1)
20120 IF ink$=="i" THEN ICE:ELSE cc:STOP
20130 DEFine PROCedure cc:CLS#0:CLS#2:CLS:END DEFine cc
20140 DEFine PROCedure l:LIST:END DEFine l
20150 DEFine PROCedure ld (file$)
20160 call$=file$
20170 file_name$=drive$&call$
20180 MERGE file_name$
20190 END DEFine ld
20200 DEFine PROCedure default (driver$)
20210 drive$=driver$
20220 END DEFine default
20230 DEFine PROCedure LRUN (file$)
20240 call$=file$
20245 NEW
20250 file_name$=drive$&call$:MERGE file_name$
20260 RUN
20270 END DEFine LRUN
20280 DEFine PROCedure llist
20290 OPEN #100,ser
20300 cc:PRINT "READY PRINTER (hit any key)":PAUSE
20310 cc
20320 LIST #100
20330 CLOSE #100
20340 DEFine PROCedure cat
20350 DIR drive$
20360 END DEFine cat
20370 DEFine PROCedure s (file$)
20380 call$=file$:SAVE drive$&call$
20390 END DEFine s
20400 DEFine PROCedure lprint (printer$)
20410 OPEN #100,ser:PRINT #100,printer$:CLOSE #100
20420 END DEFine lprint
20430 DEFine PROCedure d (file$)
20440 DELETE drive$&file$
20450 END DEFine d
20460 DEFine PROCedure ds (file$)
20470 call$=file$
20480 DELETE drive$&file$
20490 SAVE drive$&file$
20500 END DEFine ds
20510 DEFine PROCedure screen (x$)
20520 LBYTES drive$&x$,131072
20530 END DEFine screen
20540 DEFine PROCedure commands
20550 cc:PRINT "AVAILABLE COMMANDS FOR JOS"
20560 PRINT "--------------------------"
20570 RESTORE 20580:FOR LOOPER=1 TO 14:READ COM$:PRINT COM$:NEXT LOOPER
20580 DATA "LD","S","D","DS","SCREEN","CAT","LPRINT","DEFAULT","LRUN","LLIST","CC","L","SIREN","NEW"
20590 END DEFine commands
20600 DEFine PROCedure siren:BEEP 0,1,1300,150,1:END DEFine siren
20610 DEFine PROCedure NEW
20620 DLINE TO 19999
20630 cc
20640 END DEFine NEW

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.