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 ( 9 Unlock(Y/N)͸Y \~\͓<( 9 Erase! 'Ÿ; ( SŸ ͽSI{; (SŸ [I;!d(~22\!!~(#x2M1&un: !ŸrTrack-Info  * :22:Ͷ6 ! '# ! #  8 w ~>2nà!:5!F6Ͷp!w# 2S͋!ɯ2ns!~<w( G:a!n(  !4~(!Ͷ :o<(`s( Ϳ͕â'È>2r>2o͕!z8 !͎2|:: n(zͫͅì>â>>2r2o)!͕0n /D2t( dDMI| >â"~!:tO s#r::z:r== 5y== .*UWw#ͺ*"~|*~:`G# "~ʹ|:|!z8w4!˾ :r ͎ͬ!:~ =2|6ì2r!~~#~O~G#n,-. L2!y !x(/.::<('!q##p͹::< . (`.::<(â>2}2:ÈN! ~态O>G~G!~G}!ʹ!6#6#66͈_y#x#{8s+p+q! ͈q#p#wA+>2v!~=2s0:-2w~2xw$:,w*8$>2y~?( :?AͶ*U[M͂:qâ*K:-â*[*I*W"::s :,â2,*8}/_|/*KW}_*I"K}o|g"I:v(!6:x( w:w2s$:y( [8!$*>*:}D ^÷369=AEKHROUX[ϚϛϜyϞyϟyϠϡ϶ϷϸϷϹϺϻ1S!Ͽ TATUNG/XtalDOS 1.11 (C) 1983 198!O!"!"S!"01!GOϤ!~8w!(^?EETrack-Info  * :JR C,rotate:.loop LD (space),DE GLD H,D:LD L,E:ADD HL,HL:ADD HL,HL:ADD HL,DE:LD (spacer),HL:EX DE,HL ELD IY,(start):PUSH IY:ADD IY,DE:LD (check),IY:POP IX:LD (item),IX ; .newlen EEXX:LD L,(IX):LD H,(IX+1):EXX:LD L,(IX+2):LD H,(IX+3):LD C,(IX+4) EEXX:LD E,(IY):LD D,(IY+1):EXX:LD E,(IY+2):LD D,(IY+3):LD B,(IY+4)  fcp:JR C,ok ; 4.swap PUSH IX:POP HL:PUSH IY:POP DE:LD B,5:.move JLD A,(DE):LD C,A:LD A,(HL):LD (DE),A:LD (HL),C:INC HL:INC DE:DJNZ move @LD DE,(check):PUSH IX:POP HL: A:SBC HL,DE:ADD HL,DE:JR C,ok DPUSH HL:POP IY:LD DE,(spacer):SBC HL,DE:PUSH HL:POP IX:JR newlen ; 3".ok LD HL,(item):LD BC,5:ADD HL,BC:LD (item),HL :,PUSH HL:POP IX:LD DE,(spacer):ADD HL,DE:PUSH HL:POP IY >6LD DE,(end):SBC HL,DE:JR C,newlen:LD DE,(space):SRL D:RR E @LD A,D: E:JP NZ,loop:RET J; @T.fcp LD A,H:XOR D:LD A,H:RLA:RET M:JR NC,fcp0: fcp0:CCF:RET C^.fcp0 LD A,C:CP B:RET NZ:SBC HL,DE:RET NZ:EXX:SBC HL,DE:EXX:RET h; =r.start W 0:.end W 0:.spacer W 0:.check W 0:.item W 0 *|.space W 0:.error LD A,100: exterr:] $P%="Bad sort parameters"+0  pass : . Test program: : @%=20 $ "Filling 1000 real numbers..."  A(999) / I=0 999:A(I)=(0.5-(1))*10^(10-(20)): % I=0 14: A(I);:: " etc..."  "Sorting the numbers..." 9 sort,A(0) : . Call assembly language sort routine. % I=0 14: A(I);:: " etc..."  "Finished." @%=&90A DortB~=šC~šCnf"C+V+^+~=šC*C"C:!:R8SCbk))"C*C"C"Cnf#CRC.COM 5.0 6/18/82CRCKFILE???!9" 1 M @ CRC Ver 5.0 CTL-S pauses, CTL-C aborts :] O@ ++Searching for CRCKLIST file++@ Now searching for "CRCKFILE" file++ !  1 .) F!  ͡]͸! ͔0CRCKLIST???RCKFILE???!9" M à*,*.}|ډ!".*,{z{** u*.".G*.",!".***,}>*.#".ɯ22)! ",". <  NO FILECRC FILE$!   >. @ Checking with file - ! ~T #M M 2 2 2 2 ! >2 3o: : @ ***No CRC Files found***$> ʉ ʉw#: <2 P6: .6@ Can not parse string ! ~ʽT #ñM ! > 6 #6^#6! ~T #! 4M #x] #e w~ T #>2 @ - s M@ File not found ! 4 >2 o: G: „: G: „@ *Match* 2 ! 4@ <-- is, was --> : ) > T : ) M 2 ! 4<2 ~# @ Not a space between CRC values<2 G-CATALOG???SORTREALBCCRC OMBBCBASICOMx UNLIST OM CONVERT OM RUN OMHELP OMMERGE BCSORT BCF-RSER2 BC F-WSER1 BCF-WSTD BCF-WSER2 BCF-RAND1 BCF-WESER1BCF-WESER2BCF-RSTD BC F-RSER1 BCF-RAND0 BC F-RAND2 BC= !"#F-INDEX BC5$%&'ANIMAL BC()ANIMAL DAT *BBCBASICLP+,-./012BBCBASICLPH34567HELP LP589:;SETTIME BC<NAME NDX=CRCKLISTCRC >READ E @AADDRESS DTA?( . SHELL SORT ON REAL NUMERIC ARRAYS =. (c) Richard Russell 1984, from an idea by Robin Tracy.  sort 300 (exterr=&209 2 pass=0 1 <P%=sort F[OPT pass*2 PLD A,(IX):DEC A:JP NZ,error ZLD A,(IX+1):CP 5:JP NZ,error )dLD L,(IX+2):LD H,(IX+3):LD (start),HL HnDEC HL:LD D,(HL):DEC HL:LD E,(HL):DEC HL:LD A,(HL):DEC A:JP NZ,error x; CLD HL,(start):ADD HL,DE:ADD HL,DE:ADD HL,DE:ADD HL,DE:ADD HL,DE BLD (end),HL:SRL D:RR E:LD HL,&FFFF:EX DE,HL:.rotate SRL D:RR E ; A:SBC HL,DE:ADD HL,DETrack-Info  * @ ++ Now searching for "-CATALOG" file++ !  ) .) ! ”>.”#””͡”››tK››͸›* =: =͔="  ʳ ª~#.  ¿~  #~  .+~#0:0~#!A.O.Gy~#0M0 K MMɷ:m2 FSÄCRCKLIST$$$››tK›, › **}|!"*{z*~]*"Ü  DISK FULL: CRCFILE$!"*~*#"ɯ2i2}! "!"]]2 s : ~# ++FILE NOT FOUND++$: F*}’">͇†]<  CANNOT CLOSE CRCFILE$CRCKLISTCRCSK FULL: CRCFILE$  w# !]͐ DONE$!e S!]Q !eZ @ --> FILE: XXXXXXXX.XXX CRC = oS) \<‘@ ++OPEN FAILED++ !" !" * | ʹ) \!~2 #" Ý: ) > T : ) @ ++FILE READ ERROR++ <* |): o% |g}o" 2  ; 0T ~T #~A > T > _h : F{͇2h2|: ʲ !\   :\2 ! \  \ ! \  \! \  \<7=Ɓo&   ]  2h2|2   ~$#~# x  : F} *}= ">͇1 ] Ϟϛ7+G+(+{2J}2K:J_:Kob+!_OogWG +W>dO _ WDM))))B))_DM)) )~#GG~#Þ3*×Ä Î ò zL74453!?6 ,6 ,w, =2?!v"?9S?"?ͪ s Einstein BBCBASIC Version 2.31 (C) Copyright R.T.Russell 1984 7{?}:!?~0w!"?"?*?"?|( K? ."?> Z !=ͳ:2?!=ͧ ͏0|("?> GK*?|!>ʪ͎ ͑ N yʘO*? $r"?#RDM(#q#s#r#> ̓ ØANDABSACSADVALASCASNATNAUTOBGETBPUTCOLOURCOLORCALLCHAINCHR$CLEARCLOSECLGCLSCOSCOUNTDATADEGDEFDELETEDIVDIMDRAWENDPROCENDENVELOPEELSEEVALERLERROREOFEORERREXPEXTFORFALSEFNGOTOGET$GETGOSUBGCOLHIMEMINPUTIFINKEY$INKEYINTINSTR(LISTLINELOADLOMEMLOCALLEFT$(LENLETLOGLNMID$(MODEMODMOVENEXTNEWNOTOLDONOFFOROPENINOPENOUTOPENUPOSCLIPRINTPAGEPTRPIPLOTPOINT(PROCPOSPUTRETURNREPEATREPORTREADREMRUNRADRESTORERIGHT$(RNDRENUMBERSTEPSAVESGNSINSQRSPCSTR$STRING$(SOUNDSTOPTANTHENTOTAB(TRACETIMETRUEUNTILUSRVDUVALVPOSWIDTHHIMEMLOMEMPAGEPTRTIMEMissing No such Bad  rangevariableOut ofNo  spaceroomMistake,Type mismatch"Not ArraySubscriptSyntax errorEscapeDivision by zeroString too longToo big-ve rootLogAccuracy lostExp)HEX/callArgumentsCan't match  syntaxline #͎ ~(Q#^#Vz(++7B0@N #V }2?ØO( x  !?>~(#^#Vz(#7Bҗ"? =ͧ9Ͳ ͷ *?[?~(/#N#Fx(q#p# .q#p#++GN $r86#6[?*?Ny(##^#V#"?#s#r# > ͱ*DM*?^#V#B^#V#8( Failed at *? S ͼ ͷ "?y2?) program ͪ *?###> }w̓ Ø_ > i Ͳ ͎ _ > [?*?RDM!=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:[?o"<;>#~.(GMo;=2<<7,-(J>^:-~ (>T] :> T{ 6 ~ (Fw,( ^:> w-6 >^:EDITLIST\~ (~#'7/7>0 >Bad key͎<͎<͎<`iѷRDM+;x(̓<+ R}G ~" O#~ ("(#|̋6BK!;R( BK·d<BKyx(̓<# {6DMBK;·</7))) DM>)7{= ~ 8/7{/7{ > ɐu 1Y!*."!Y"UNLIST Version 1.1 :] ]UNLIST modifies a BBC BASIC program so that it can be RUN but cannot be LISTed or CONVERTed to ASCII. This modification cannot be reversed! Its options are as follows: UNLIST Prints this description. UNLIST filename Modifies filename.BBC so that it cannot be LISTed. The original file is renamed filename.BAK. Note that the same restrictions apply to UNLIST as to RENUMBER; that is, the program must not use calculated line numbers in GOTO, GOSUB or RESTORE statements.!\$!~e!x x(SGxx!xw#H> ́*s#r#"[R8Insufficient memoryǯ*w#w2h2| 0x(%͞xOxG͗y͞x͞Gx͞կ͞>͞>͞ͽͭe!{Wl!\e!xu!{^e!~u!x^BBCBAK$$$~W_zW!Y^#V#z(B >m< Close errore>mEnd of file - abortͭe>m~<#~ {( > :ê>}>8M / h aw GGp1S$~Z8{fR?- wqjd_YTPKGC?<85~$9#=!>p3U0~3BKoggoOm }(88go /ogS"ê. .V I0p3~3 ( 2Q̏3A(lyO!P3 ~p#wy 89@8`0-/""*"*"!"S"yO;>{êV >29282?go""""}Ϟ;V 8}G} G~wp3{ > 9    V I0V ,,**K K o>88N65 >Directory fullͼ5 B(0>ͨ5<>Close error{ 4 ɯ2<=6ȯw+w!%~#ļ5!K?B S?7͎4(,_2<4^:0!<^w2<>8N65 >File not foundͣ5 5 B0?N655͂4!<~+(+>Too many open files[?s#rx!"?!\$#q#G̓5xIG%6x+p#N˹4# ẁ5%6N˹4# F5̀5x%6+~<%6\$>#ͨ5%6~++V+^+fo:U)CL_%6~(w+++V+^B#5+++6+p+qͼ5ͣ5+˾+w6##ůw#75̓5<6>!O6>(ͨ5(3>Disk full!!4#(\>ͨ5<5\>ͨ5>ͨ5<\ ?(>Bad name>ͨ5=6!%3>Channel{_!<^#Vz> e!6!|q#O6" $#͖6"#({>Bad string~#`?@#~:+x ~9@0##\~.(" ( (=("(?*(  #| ͋6y9~#*(. e(+~ #BBC6~908:8 A8G0))))_#~, #6~08:0{_~#_6.\8!99( 8~#(###9.( ((~#(~#fo6>N65:e2ePN6I E&AN6:\=8_5N6#=(9T 0~#9O '=)88N6)885\~ yͨ5>Bad command \!lNwy#5>File existsN67+ #7 ȷR#>?P6 !6\yͨ5S `_!^#~ x> ̼8^:> {(>*9>.9S :\=707{2<>>3~ x2<͂4*?r9 Z "?"<4`_BYCHAҝ>Ä!<~677>:^:^:~#^: Bad sum:!_S_z: !ͧ9:< >8>ͨ5:<>ܨ5:<{4!<4:<(2<*<> w^:.M(~# _Ă: > ^:͂:+y7:O:^: (2(qTrack-Info  * Disk full\>m6<File not found>m>m6<Directory full\>\>>mOF\!N  ~ ˹qN! w ˹q~>͞~#_>my͞x͞Gx͞կ͞>͞>͞ͽͭe!{Wl!\e!xu!{^e!~u!x^BBCBAK$$$~W_zW!Y^#V#z(B >m< Close errore>mEnd of file - abortͭe>m1v ! !" CONVERT Version 2.3 :] ‘ CONVERT converts between BBC BASIC internal format (.BBC ) and ASCII (.BAS). Its options are as follows: CONVERT Prints this description. CONVERT filename.BBC Converts from BBC BASIC internal format to ASCII. CONVERT filename.BAS Converts from ASCII to BBC BASIC internal format.  !\$ e!(ͽ ǯͽ >ͽ >ͽ ! 4 !6 F v ( (( > w#([ !6 ͥ|[ " 7R6 6 R }ͽ }ͽ |ͽ !6 ~ͽ ~# M Line too long - abort. ** Line number added ** * # ** Line number out of sequence ** ɀANDABSACSADVALASCASNATNAUTOBGETBPUTCOLOURCOLORCALLCHAINCHR$CLEARCLOSECLGCLSCOSCOUNTDATADEGDEFDELETEDIVDIMDRAWENDPROCENDENVELOPEELSEEVALERLERROREOFEORERREXPEXTFORFALSEFNGOTOGET$GETGOSUBGCOLHIMEMINPUTIFINKEY$INKEYINTINSTR(LISTLINELOADLOMEMLOCALLEFT$(LENLETLOGLNMID$(MODEMODMOVENEXTNEWNOTOLDONOFFOROPENINOPENOUTOPENUPOSCLIPRINTPAGEPTRPIPLOTPOINT(PROCPOSPUTRETURNREPEATREPORTREADREMRUNRADRESTORERIGHT$(RNDRENUMBERSTEPSAVESGNSINSQRSPCSTR$STRING$(SOUNDSTOPTANTHENTOTAB(TRACETIMETRUEUNTILUSRVDUVALVPOSWIDTHHIMEMLOMEMPAGEPTRTIME ~ #!6~F#(#~(#~ #~.((8~ +xz> ͽ v ʶ " MC½ ͈ !6 ~#Ľ ~( 'R<0=(Ľ x()T]))7!~0:#)T]))_~$%(0:?A[?_{?#~ 0˩˙ (,(G8˙" ?a(ˡͥ|Ī ( *(80@( ( (8& ! ! :v Gv W˲xGov W˲xg6#zG{Tw#{?@w#z?@w# >b < Close errorZ >b Z >b Disk full\>b 6< File not found >b >b 6< Directory full>b OF \!6 N  ~ ˹q End of file - abort> ͽ > N ! w ˹q~>ͽ  ~# _>b G8˙" ?a(ˡͥ|Ī ( *(80@( ( (8& ! ! :v Gv W˲xGov W˲xg6#zG{Tw#{?@w#z?@w# >b < Close errorZ >b Z >b Track-Info  * (F)=65536: 4A(F)=#F(F):B(F)=#F(F):C(F)=#F(F):#F(F),A$(F) L(F)=B(F)+256*C(F)  :  WRITE(F) ,#F3,A(F):#F3,B(F):#F3,C(F):#F3,A$(F)  ot found" F(1)<>0 :  "OUTPUT FILE",F3$ F3=(F3$) ! F3=0 "Directory full" : : READ(0):READ(1)  7 L(0)2?!e~ 6?\Z:g!")`1!~:wͨev*͗@GʝҦw ҝ*¹#w~#  ¹#~:ʮ¹w*͢#~g͗_ ~#\*"6|*%>?>~ n o#Y##͗:=2Agv͗͢> > >2!͢>A2z~:v :<2>.> Yû"͢Y~: #:Gp͗:=2;v͢HELP V1.2 $ ++ EOI ++ TYPE CTRL-C TO RETURN TO CP/M, TO CONTINUE -$ HELP FILE SELECTIONS ARE -- $HELP HLP TYPE "A"=ABORT, CTRL-C=CP/M, =CONT -$ HELP FATAL ERROR -- FILE NOT FOUND$ HELP ERROR -- INVALID RESPONSE $ HELP ERROR -- EOF ON HELP FILE $ HELP ERROR -- INSUFFICIENT MEMORY $ TYPE CTRL-C TO RETURN TO CP/M, "*" TO SELECT ALL, OR ENTER SELECTION - $A"=ABORT, CTRL-C=CP/M, =CONT -$ HELP FATAL ERROR -- FILE NOT FOUND$ HELP ERROR --:THE HELP SUBSYSTEM FOR ONLINE DOCUMENTATION THIS IS HELP, THE ONLINE DOCUMENTATION SUBSYSTEM. THE PURPOSE OF HELP IS TO ALLOW THE USER TO INTERACTIVELY QUERY THE *.HLP FILES OF THE SYSTEM IN ORDER TO RECEIVE INFORMATION SUMMARIES ON VARIOUS ASPECTS OF THE USER'S WORKING ENVIRONMENT, SUCH AS THE LANGUAGE SYSTEMS HE IS USING AND CERTAIN SUBSYSTEMS AVAILABLE TO HIM. WHEN THE USER TYPES 'HELP', A SEARCH IS DONE FOR THE FILE 'HELP.HLP'. IF FOUND, THE CONTENTS OF THIS HELP FILE IS DISPLAYED TO THE USER; IF NOT FOUND, THE HELP INFORMATION YOU ARE NOW READING IS DISPLAYED. IF THE USER DESIRES INFORMATION ON A SPECIFIC TOPIC AND HE HAS A HELP FILE OF THAT NAME (IE, CPM.HLP IS A HELP FILE ON CP/M), HE MAY ISSUE OF HELP COMMAND OF THE FORM -- HELP D:TOPIC WHERE "D:" IS THE DISK THE HELP FILE RESIDES ON (OPTIONAL) AND "TOPIC" IS THE NAME OF THE HELP FILE (TOPIC.HLP, LIKE CPM.HLP). PLEASE REFER TO THE HELP FILE "HELP.HLP" FOR MORE INFORMATION. ". MERGE UTILITY FOR BBC BASIC . R.T.RUSSELL, 16-10-1982 : $ A(1),B(1),C(1),F(1),L(1),A$(1) :   "FILE 1",F1$ F(0)=(F1$)  F(0)=0 "File not found" F(0)<>0 :   "FILE 2",F2$ F(1)=(F2$)  F(1)=0 "File not found" F(1)<>0 :  "OUTPUT FILE",F3$ F3=(F3$) ! F3=0 "Directory full" : : READ(0):READ(1)  7 L(0)EOFstats : " _end ,#stats 6 @: J: >T Open the file and read its length from the first record. D^ Set the file number (stats) and the position of the last valid 4h data byte in the file (eof) - ie its length-1. r: | _open(name$) file_num=(name$) #file_num,EOFfnum  ave<FFPPZZddnnx  !#stats,name$,age,height,sex$  "Name ";name$  "Age ";age % "Height in centimeters ";height & sex$="M" "Male" "Female"   #stats>EOFstats : " _end ,#stats 6 @: J: >T Open the file and read its length from the first record. D^ Set the file number (stats) and the position of the last valid 4h data byte in the file (eof) - F_WSER : 8 EXAMPLE OF WRITING TO A SERIAL CHARACTER DATA FILE (: F2 This program openes a data file and writes serial character data @< to it. The use of OPENOUT ensures that, eaven if the file P separated by commas. Each record is terminated by CR LF 0Z and the file is terminated by a Control Z. d: n: ?x Functions are used to accept and validate the data before  writing it to the file. : : 5record$=100," "): Reserve room for the longest 4name$=20," ") record necessary. It saves 0: on string space. compat=("COMPAT") 2 "File Name COMPAT Opened as Channel ";compat   name$=_name  name$="" _end age=_age height=_height sex$=_sex  3"record$=name$+","+(age)+","+(height)+","+sex$ ,#compat,record$ 6#compat,&0A @ J: T _end ^#compat,&1A h#compat r |: : D Accept a name from the keyboard and make sure it consists only C of spaces and upper or lower case characters. Leading spaces ) are automatically ignored on input. :  _name  name$,FLAG,n  FLAG=  "Name ? " name$  name$="" TfB  I=1 (name$) n=(name$,I,1)) 3 (n=32 n>64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!" & FLAG 0=name$ :: D: JN Accept the age from the keyboard and round to one place of decimals. FX Ages of 0 and less or 150 or more are considered to be in error. b: l _age v age   "What age ? " age < age<=0 age >=150 "No impossible ages please !!!"  age>0 age<150 =(age*10+.5)/10 : : E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  '  "Height in centimeters ? " height 4 height<=50 height>=230 "Verry funny !!!"   height>50 height<230 *=(height+.5) 4: >: HH Accept the sex from the keyboard. Only words beginning with upper BR or lower case M or F are acceptable. The returned string is \ truncated to 1 character. f: p _sex z sex$,FLAG  FLAG= ' "Male or Female - M or F ? " sex$ + sex$<>"" sex$=((sex$,1,1)) 95) $ sex$<>"M" sex$<>"F" FLAG= - FLAG "No more sex(es) please !!!"  FLAG =sex$ Necord$dBPAULINE SMITH,32,153,F Track-Info  *           length (0) as the first record. | Return the file number. :  _open(name$)  fnum fnum=(name$) #fnum,0 =fnum : : E Write the length of the file to the first record and then close / the file. Return the length of the file. :  _close(fnum)  EOFfnum EOFfnum=#fnum-1 #fnum=0 #fnum,EOFfnum &#fnum 0=EOFfnum :: D: DN Accept a name from the keyboard and make sure it consists only CX of spaces and upper or lower case characters. Leading spaces )b are automatically ignored on input. l: v _name  name$,FLAG,n  FLAG=  "Name ? " name$  name$="" ddB  I=1 (name$) n=(name$,I,1)) 3 (n=32 n>64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!"  FLAG =name$ : : J  Accept the age from the keyboard and round to one place of decimals. F Ages of 0 and less or 150 or more are considered to be in error.  : * _age 4 age > H "What age ? " age =150 "No impossible ages please !!!" \ age>0 age<150 f=(age*10+.5)/10 p: z: E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  ' "Height in centimeters ? " height 4 height<=50 height>=230 "Verry funny !!!"  height>50 height<230 =(height+.5) : : H Accept the sex from the keyboard. Only words beginning with upper B or lower case M or F are acceptable. The returned string is  truncated to 1 character. $: . _sex 8 sex$,FLAG B LFLAG= 'V "Male or Female - M or F ? " sex$ +` sex$<>"" sex$=((sex$,1,1)) 95) $j sex$<>"M" sex$<>"F" FLAG= -t FLAG "No more sex(es) please !!!" ~ FLAG =sex$ ave<FFPPZZddnnxxnny !!!"  height>50 height<230 =(height+.5) : : H Accept the sex from the keyboard. Only words beginning wit F_RAND1  SIMPLE DATABASE PROGRAM & Written by R T Russell Jan 1983 (: ;2 This is a simple database program. You are asked for 8< the name of the file you wish to use. If the file :F does not already exist, you are asked to specify the 9P number and format of the records. If the file does 8Z already exist, the file specification is read from d the file. n: x: @%=10   0 7 '"Enter the filename of the data file: "filename$ fnum=(filename$) fnum=0 _setup _readgen base=#fnum: :  " '"Enter record number: "ans$  ans$="0" #fnum:: . ans$="" record=record+1 record=(ans$) #fnum=_ptr(record) _display / '"Do you wish to change this record",ans$ #fnum=_ptr(record) " _test(ans$) _modify , 6 @: )J _test(A$) =A$,1)="Y" A$,1)="y" T: &^ _ptr(record)=base+record*length h: r _setup | "New file." fnum=(filename$) . fnum=0 "Sorry, disk directory full.": 1 "Enter number of fields per record: "fields , title$(fields),size(fields),A$(fields)  field=1 fields 1 '"Enter title of field number ";field;": ";  ""title$(field)   6 "Maximum size of field (characters)",size(field) % size(field)>0 size(field)<256  field length=1 #fnum,fields  field=1 fields $#fnum,title$(field),size(field) &length=length+size(field)+1 0 field : D: N _readgen Xlength=1 b#fnum,fields ,l title$(fields),size(fields),A$(fields) v field=1 fields $#fnum,title$(field),size(field) length=length+size(field)+1  field  :  _display  '"Record number ";record' flag=#fnum - #fnum flag=0 "Record not stored":  field=1 fields #fnum,A$(field) ! title$(field);" ";A$(field)  field   :  _modify (  '"(Enter for no change)"' * field=1 fields 4 > title$(field);" "; H ""A$ /R A$="" (&0B)title$(field);" ";A$(field) \ (A$)<=size(field) f A$<>"" A$(field)=A$ pTrack-Info  *          ile 'AT END'. : E" PTR is set to the last valid data byte+1 and the file number is H, returned. If the file does not already exist, it is still opened, 6 but PTR is left at 0. @: J _openend(name$) T fnum ^fnum=(name$) #h fnum=0 fnum=(name$): =fnum r#fnum=(#fnum)-128 | last_PTR=#fnum #fnum,dummy$  #fnum dummy$="" #fnum=last_PTR =fnum  hbyte=#compat r byte=&1A #compat: =| (byte=&0A byte=&0D byte=&2C) data$=data$+(byte)  by F_WESER2 : G EXAMPLE OF WRITING AT THE END OF A SERIAL MIXED NUMERIC/CHARACTER ( DATA FILE 2: I< This program opens a data file, sets PTR to its end and then writes (F numeric and character data to it. P: GZ If the file is being opened for the first time, a dummy length is Ed written as the first record. When the file is closed the first Cn record is changed to the value of PTR. Functions are used to Fx open and close the file. The closing function returns the final , value of PTR (the length of the file). : D Functions are also used to accept and validate the data before  writing it to the file. : : stats=_open("STATS") 0 "File Name STATS Opened as Channel ";stats   name$=_name  name$="" _end age=_age height=_height sex$=_sex  !"#stats,name$,age,height,sex$ , 6: @ _end 4J "The last byte was written at ";_close(stats) T ^: h: Dr Open the file and, if it exists, set PTR to the end and return field #z '"Confirm update record",ans$  _test(ans$) #fnum,255  field=1 fields #fnum,A$(field)  field  ((22<<FFPPZZddnnxx"",ld);" ";A$(field)  field   :  _modify (  '"(Enter for no change)"' * field=1 fields 4 > title$(field);" "; H ""A$ /R A$="" (&0B)title$(field);" ";A$(field) \ (A$)<=size(field) f A$<>"" A$(field)=A$ p F_WESER1 : E EXAMPLE OF WRITING A TO THE END OF A SERIAL CHARACTER DATA FILE (: F2 This program opens a file and sets PTR to the end before writing < more data to it. F: *P A function is used to open the file. Z: d: "nphonenos=_openend("PHONENOS") 6x "File Name PHONENOS Opened as Channel ";phonenos    "Name ? " name$  name$="" _end  "Phone Number ? " phone$  #phonenos,name$,phone$  : _end #phonenos  : :  Open the fTrack-Info  *          D| the file number. If it does not exist, open it, write a dummy < length as the first record and return the file number. :  _open(name$)  fnum,ptr fnum=(name$) 3 fnum>0 #fnum,EOFfnum:#fnum=EOFfnum: =fnum fnum=(name$) #fnum,0 =fnum : : E Write the length of the file to the first record and then close / the file. Return the length of the file. :  _close(fnum)  EOFfnum &EOFfnum=#fnum-1 0#fnum=0 :#fnum,EOFfnum D#fnum N=EOFfnum X: b: Dl Accept a name from the keyboard and make sure it consists only Cv of spaces and upper or lower case characters. Leading spaces ) are automatically ignored on input. :  _name  name$,FLAG,n  FLAG=  "Name ? " name$  name$="" TBC  I=1 (name$) n=(name$,I,1)) 3 (n=32 n>64 n<91 n>96 n<123) FLAG=  1 FLAG "No funny characters please !!!"  FLAG =name$ :  : J* Accept the age from the keyboard and round to one place of decimals. F4 Ages of 0 and less or 150 or more are considered to be in error. >: H _age R age \ f "What age ? " age =150 "No impossible ages please !!!" z age>0 age<150 =(age*10+.5)/10 : : E Accept the height in centimeters from the keyboard and round to F an integer. Heights of 50 or less and 230 or more are considered  to be in error. :  _height  height  ' "Height in centimeters ? " height 4 height<=50 height>=230 "Verry funny !!!"  height>50 height<230 =(height+.5) : : H$ Accept the sex from the keyboard. Only words beginning with upper B. or lower case M or F are acceptable. The returned string is 8 truncated to 1 character. B: L _sex V sex$,FLAG ` jFLAG= 't "Male or Female - M or F ? " sex$ +~ sex$<>"" sex$=((sex$,1,1)) 95) $ sex$<>"M" sex$<>"F" FLAG= - FLAG "No more sex(es) please !!!"  FLAG =sex$ N GePZZddnnxx F_RSTD : / EXAMPLE OF READING A COMPATIBLE DATA FILE (: D2 This program opens a data file and reads numeric and character >< data from it. The data is read a byte at a time and the ;F appropriate action taken depending on whether it is a 1P character, a comma, or a control character. Z: d: ncompat=("COMPAT") 2x "File Name COMPAT Opened as Channel ";compat   name$=_read  "Name ";name$ age=(_read)  "Age ";age height=(_read) % "Height in centimeters ";height sex$=_read & sex$="M" "Male" "Female"   : : > Read a data item from the file. Treat commas and CRs as A data item terminators and Control Z as the file terminator. @" Since we are not interested in reading a record at a time, B, the record terminator CR LF is of no spacial interest to us. 6: @ _read J data$,byte$,byte Tdat$="" ^ hbyte=#compat r byte=&1A #compat: =| (byte=&0A byte=&0D byte=&2C) data$=data$+(byte)  byte=&0D byte=&2C =data$ +((22<<FFPPdZndnx ,@|at commas and CRs as A data item terminators and Control Z as the file terminator. @" Since we are not interested in reading a record at a time, B, the record terminator CR LF is of no spacial interest to us. 6: @ _read J data$,byte$,byte Tdat$="" ^ hbyte=#compat r byte=&1A #compat: =| (byte=&0A byte=&0D byte=&2C) data$=data$+(byte)  byTrack-Info  * NDZERO" ! fnum=0 "Directory Full": :  " '"Enter record number: "ans$  ans$="0" #fnum:: . ans$="" record=record+1 record=(ans$) #fnum=_ptr(record) _display / '"Do you wish to change this record",ans$ "#fnum=_ptr(record) , _test(ans$) _modify 6 @ J: T: )^ _test(A$) =A$,1)="Y" A$,1)="y" h: r _ptr(record)=record*83 |:  _display  '"Record number ";record' flag=#fnum - #fnum flag=0 "Record not stored": #fnum,name$,remark$  name$;" ";remark$ '  :  _modify ( '"(Enter for no change)"'  "Name ",temp$ temp$=temp$,30)  temp$<>"" name$=temp$  "Remark ",temp$ temp$=temp$,50)  temp$<>"" remark$=temp$ #& '"Confirm update record",ans$ 0 _test(ans$) :#fnum,255 D#fnum,name$,remark$ N t (2<FP Z"d$n*83 |:  _display  '"Record number ";record' flag=#fnum - #fnum flag=0 "Record not stored": #fnum,nam F_RAND2 : & Written by Doug Mounter - Jan 82 (: %2 EXAMPLE OF A RANDOM ACCESS FILE <: 6F This is a simple inventory program. It uses the /P item's part number as the key and stores: 7Z The item description - character max length 30 'd The quantity in stock - numeric 'n The re-order level - numeric 'x The unit price - numeric 7 In addition, the first byte of the record is used 8 as a valid data flag. Set to 0 if empty, D if the 3 record has been deleted or V if the record is valid. 0 This gives a MAX record length of 47 bytes , (Don't forget the CR after the string) : : _initialise !inventry=_open("B:INVENTRY")    0,3);"If you want to:-"' ! "End This Session";37);"0" - "Amend/Create/Delete an Entry";37);"1" 3 "Display the Inventory for One Part";37);"2" 3" "Change the Stock Level of One Part";37);"3" 2, "Display Items Below Reorder Level";37);"4" 26 "Recover a Previously Deleted Item";37);"5" #@ F_RSER : 0 EXAMPLE OF READING A SERIAL CHARACTER FILE (: G2 This program opens a previously written serial file and reads it. <: F: Pphonenos= "PHONENOS" 6Z "File Name PHONENOS Opened as Channel ";phonenos d n x#phonenos,name$,phone$  #phonenos _end  name$,phone$  : _end #phonenos  &;honenosPHONENOSBBC F_RAND0 : ' VERY SIMPLE RANDOM ACCESS PROGRAM (: :2 This program maintains a random access file of names :< and remarks. Each name can be up to a maximum of 30 :F characters long and each remark up to 50 characters. ;P The first byte of the record is set non zero (in fact 6Z &FF) if there is a record present. This gives a 8d maximum record length of 1+31+51=83. (Don't forget n the CRs.) x: : @%=10 temp$=50," ")   0 fnum= "RANDZERO"  fnum=0 fnum= "RATrack-Info  *  "List Deleted Items";37);"6" 'J "Set Up a New Inventory";37);"9" T ^ 0,15);bell$; $h "Enter selection (0/6 or 9) "; rfunction$= 3| function$>"/" function$<"8" function$="9" function=(function$) ? function dtA,t^B,TjC,DLD,DFE,TDF,djF,d~F,TpG  function=0   "Inventory File Closed" '' #inventry  : :  AMEND/CREATE AN ENTRY :    "AMEND/CREATE/DELETE" partno=_getpartno flag=_getrec(partno,"V") &_display(flag) 0'"Do you wish to "; 9: flag "change this entry ? "; "enter data ? "; *D <>"N" flag=_amend(partno): cteos$ N_write(partno,flag,type) -X bell$;"Amend/create another record ? "; b ="N" l v: :  DISPLAY AN ENTRY :    "DISPLAY" partno=_getpartno flag=_getrec(partno,"V") _display(flag)  ' . "Do you wish to view another record ? ";  ="N"  :  : ) CHANGE THE STOCK LEVEL FOR ONE PART  : * 4 > "CHANGE STOCK" Hpartno=_getpartno Rflag=_getrec(partno,"V") \ f_display(flag) p cteos$; z  0,12);cteol$; ) "What is the stock change ? " temp$ change=(temp$) ( (change)=change stock+change>=0  temp$="" flag=: dhC stock=stock+change _display(flag) '"Is this correct ? "; temp$= :  flag temp$="Y" _write(partno,flag,"V")  return$;bell$; ( "Update any more stock levels ? ";  ="N"  $: .: '8 DISPLAY ITEMS BELOW REORDER LEVEL B: Lpartno=1 V ` "j "ITEMS BELOW REORDER LEVEL"' tline_count=2 ~ flag=_getrec(partno,"V") # (flag stockmaxpartno line_count>20 temp$<>"" ; 0,23);bell$;"Push any key to continue or E to end "; temp$= " partno>maxpartno temp$="E" partno=0  : (: 2 RECOVER A DELETED ENTRY <: F P Z "RECOVER DELETED RECORDS" dpartno=_getpartno nflag=_getrec(partno,"D") x_display(flag)   flag t~E ' "Type Y to recover this record "; temp$= ) temp$="Y" _write(partno,flag,"V") : 6 return$;bell$;"Recover another record ? "cteol$;  ="N"  : :  LIST DELETED ENTRIES : partno=1   " "DELETED ITEMS"' ,line_count=2 6 @flag=_getrec(partno,"D") J flag D|F T "Part Number ";partno ^ "Description ";desc$' hline_count=line_count+3 r: |partno=partno+1 temp$=(0) 2 partno>maxpartno line_count>20 temp$<>"" ; 0,23);bell$;"Push any key to continue or E to end ";  partno>maxpartno ="E" partno=0  : : 2 DUMMMY RETURNES FOR INVALID FUNCTION NUMBERS :  :  : : * REINITIALISE THE INVENTORY DATA FILE &: 0 :: 0,3);bell$;"Are you sure you want a new inventory?" /D "You will DESTROY ALL YOUR CURRENT DATA." /N '"It would be safer to use a new disk in" 1X "drive 1: and start a new inventory file."' "b "If you are SURE, enter YES" -l "If you want a new inventor, enter NEW" )v "Otherwise, just hit return ",temp$ # temp$="YES" _setup(inventry)  temp$="NEW" function=0  : : , INITIALISE ALL THE VARIOUS PRESETS ETC :  _initialise bell$=(7) return$=(13) cteol$=(&15) cteos$=(&16) clrline$=return$+cteol$ rec_length=47 partno=0 desc$=30," ")  temp$=40," ") * 0 4 >: H: .R OPEN THE FILE AND RETURN THE FILE NUMBER \: 7f If the file already exists, the largest permitted )p part number is read into maxpartno. 9z If it is a new file, file initialisation is carried 2 out and the largest permitted part number is " written as the first record. :  _open(name$) fnum=(name$) $ fnum>0 #fnum,maxpartno: =fnum fnum=(name$) ) fnum=0 "Disk Directory Full."!!:  _setup(fnum) =fnum :  SET UP THE FILE  : 5 Ask for the maximum part number required, write 3 it as the first record and then write 0 in to %$ the first byte of every record. . : 8 _setup(fnum) B L 0,12);cteos$;bell$; FV "What is the highest part number required (Max 5000) ",maxpartno ;` maxpartno>0 maxpartno<5000 (maxpartno)=maxpartno j #fnum=0 t #fnum,maxpartno ~ partno=1 maxpartno  #fnum=_ptr(partno) #fnum,0  partno=0   :  : - GET AND RETURN THE REQUIRED PART NUMBER  :  _getpartno   0,5);cteos$;bell$; 6 "Enter a Part Number Between 1 and ";maxpartno '  partno=maxpartno TrJ ) "The Next Part Number is ";partno+1 $ "Just hit RETURN to get this"' ( : 12 "What is the Part Number You Want ",partno$ *< partno$<>"" partno=(partno$): DZJ 1F partno=maxpartno partno=0 partno=partno+1 P : Z 35,10);partno;cteol$ ' 6d partno>0 partno"/" function$<"5" function=(function$) " 37,function+5);"*"; &, function tZA,t^B,TjC,d|C 6 function=0 @ J_close_files T #^ "Address Book Files Closed"'' h r: |:  ENTER DATA : flag= temp$="" i=1   _get_data / length=maxrec data$(1)="" flag=: T\B > data$(1)="+" data$(1)="-" _message("Bad Data"): T\B i=_find_place(0,data$(1)) ' i>0 _message("Duplicate Record") ! '"Is this data correct ? "; temp$= :  flag temp$="Y" & flag DbB %0_put_index(i,data$(1),#datanum) : i=2 7 D#datanum,data$(i) N X: b flag l v: :  SEARCH FOR AN ENTRY : i=1   0,11);cteol$; + "What name do you want to look for "'  0,13);cteol$;  name$  name$="" dnB B name$<>"" name$="DELETE" _delete(i) i=_display(i,name$)  name$=""  :  :  LIST IN ALPHABETICAL ORDER  : *entry=1 4 curoff$; > H Rline_count=0 \ f 0,line_count); p_read_data(entry) z_print_data entry=entry+1 line_count=line_count+8 temp$=(0) . entry>length line_count>16 temp$<>"" 6_message("Push any key to continue or E to end ")  entry>length ="E"  curon$;  : : ( REORGANISE THE DATA FILE AND INDEX : entry=1 5 0,13);"Reorganising the Data File and Index" ' newdata="ADDRESS.BAK" newindex="NAME.BAK" 6$ newdata=0 newindex=0 "Disk Directory Full": .#newdata,0 8 B_read_data(entry) Lindex(entry)=#newdata V i=2 7 `#newdata,data$(i) j tentry=entry+1 ~ entry>length EOFnewdata=#newdata-1 #newdata=0 #newdata,EOFnewdata #0 , "Re-naming the Data and Index Files" ' *REN ADDRESS.$$$=ADDRESS.BAK *REN NAME.$$$=NAME.BAK *REN ADDRESS.BAK=ADDRESS.DTA *REN ADDRESS.DTA=ADDRESS.$$$ *REN NAME.BAK=NAME.NDX *REN NAME.NDX=NAME.$$$ indexnum= "NAME.NDX" datanum= "ADDRESS.DTA"  #datanum,EOFdata #datanum=EOFdata+1  (: 2: %< INITIALISE VARIABLES AND ARRAYS F: P: Z: d _initialise n 0 xesc$=(27) bell$=(7) cteol$=(&15) cteos$=(&16) return$=(13) clrline$=return$+cteol$ curoff$=(&14) curon$=(&11) : 7 The maximum record number, maxrec, is sxist, load desc$ with "No Record" - The remainder of the record is set to 0  :  _getrec(partno,type) stock=0 reord=0 price=0  #inventry=_ptr(partno)  test=#inventry " test=0 desc$="No Record": =  test=type TvK < type=86 desc$="Record Deleted" desc$="Record Exists" " = , : 6 #inventry,desc$ @ #inventry,stock,reord,price J = T : ^ : 0h CALCULATE THE VALUE OF PTR FOR THIS RECORD r : 2| _ptr(partno)=partno*rec_length+5-rec_length  :  :  AMEND THE RECORD  :  _amend(partno)  clrline$;0,4); / "Please Complete for Part Number ";partno + "Just hit Return to leave unchanged"' flag= type="V"  "Description ";cteol$;  "" temp$ " temp$="DELETE" type="D": =  temp$=temp$,30) " temp$<>"" desc$=temp$:flag= 3 desc$="No Record" desc$="Record Deleted" = )& "Current Stock Level " temp$ %0 temp$<>"" stock=(temp$):flag= ): "Reorder Level " temp$ %D temp$<>"" reord=(temp$):flag= )N "Unit Price " temp$ %X temp$<>"" price=(temp$):flag= b =flag l : v :  WRITE THE RECORD  :  _write(partno,flag,type)  flag  #inventry=_ptr(partno)  #inventry,type & #inventry,desc$,stock,reord,price   :  : DISPLAY THE RECORD DETAILS  :  _display(flag)  0,5);cteos$; $ "Part Number ";partno' " "Description ";desc$  flag "* "Current Stock Level ";stock "4 "Reorder Level ";reord "> "Unit Price ";price H ((22<<FFPPZZddnnxxte(partno,flag,type)  flag  #inventry=_ptr(partno)  #inventry,type & #inventry,desc$,stock,reord,price   :  : DISPLAY THE RECORD DETAILS  :  _display(flag)  0,5);cteos$; $ "Part Number ";partno' " "Description ";desc$  flag "* "Current Stock Level ";stock "4 "Reorder Level ";reord "> "Unit Price F_INDEX  EXAMPLE OF AN INDEXED FILE : ;( This is a simple address book filing system. It will =2 accept names, telephone numbers and addresses and store 9< them in a file called ADDRESS.DTA. The index is in :F name order and is kept in a file called ADDRESS.NDX. 9P All the fields are character and the maximum length Z of any field is 30. d: n: x_initialise _open_files   0,3);"If you want to:-" ' % 5);"End This Session";38);"0"  5);"Enter Data";3Track-Info  * et/read in  PROC_setup/PROC_read_index :  message$(7)  i=1 7  message$(i)  : Name,Phone,Address,-- " --,-- " --,-- " --,Post Code ": , data$(7) 6 i=1 7 @data$(i)=30," ") J Ttemp$=255," ") ^temp$="" h r: |:  OPEN THE FILES :  _open_files indexnum="NAME.NDX" datanum="ADDRESS.DTA" 3 indexnum=0 datanum=0 _setup _read_index  : : % SET UP NEW INDEX AND DATA FILES :  _setup  & 0,13);"Setting Up Address Book" maxrec=10 indexnum="NAME.NDX" &datanum="ADDRESS.DTA" 60 indexnum=0 datanum=0 "Disk Directory Full": :#indexnum,0,maxrec D#datanum,0 &N index$(maxrec+1),index(maxrec+1) Xlength=0 bindex$(0)="" lindex(0)=0 vindex$(1)=(&FF) index(1)=0  : : ( READ INDEX AND LENGTH OF DATA FILE :  _read_index  #indexnum,EOFindex,maxrec ' index$(maxrec+1), index(maxrec+1) index$(0)="" index(0)=0 length=0   length=length+1 +#indexnum,index$(length),index(length)   #indexnum>EOFindex *index$(length+1)=(&FF) 4index(length+1)=0 >#datanum,EOFdata H#datanum=EOFdata+1 R \: f: >p WRITE INDEX, MAXREC AND NEW EOF POINTERS AND CLOSE FILES z:  _close_files EOFdata=#datanum-1 #datanum=0 #datanum,EOFdata #indexnum=10  i=1 length !#indexnum,index$(i),index(i)  EOFindex=#indexnum-1 #indexnum=0 #indexnum,EOFindex,maxrec #0   :  :  WRITE A MESSAGE AT LINE 23 $ : . _message(line$) 8 x,y B x= L y= V 0,23);bell$;line$; ` x,y); j t : ~ : ' GET INPUT DATA - LIMIT TO 25 CHAR  :  _get_data  i  0,13);cteos$ 2 length=maxrec _message("Address Book Full") i=1 7  5);message$(i);14); temp$  data$(i)=temp$,25)  data$(1)="" i=7    :  : ) FIND AND DISPLAY THE REQUESTED DATA ( : 2 _display(i,name$) < 0,12);cteos$ F i=_find_place(i,name$) :P i<0 _message("Name Not Known - Next Highest Given") Z _read_data(i) d n _print_data x =i  :  : % DELETE THE ENTRY FROM THE INDEX  :  _delete(i) # 17,13) "Are you SURE ",temp$  0,-1);cteos$;  temp$<>"YES"  i<0 i=-i  i=i length  index$(i)=index$(i+1)  index(i)=index(i+1)   length=length-1   : " : , READ DATA FOR ENTRY i 6 : @ _read_data(i) J PTRdata=#datanum T i<0 i=-i ^ #datanum=index(i) h data$(1)=index$(i) r i=2 7 | #datanum,data$(i)   #datanum=PTRdata   :  :  PRINT data$() ON VDU  :  _print_data  i i=1 7 2 data$(i)<>"" 5);message$(i);15);data$(i)  data$(1)=(&FF) i=7    :  : ,& PUT A NEW ENTRY IN INDEX AT POSITION i 0 : : _put_index(i,entry$,ptr) D j N i<0 i=-i X j=length+1 i -1 b index$(j+1)=index$(j) l index(j+1)=index(j) v  index$(i)=entry$  index(i)=ptr  length=length+1   :  : , FIND ENTRY IN INDEX OR PLACE TO PUT IT  :  _find_place(i,entry$)  top,bottom  i<0 i=-i entry$="+" i1 =i-1  entry$="-" i=1 =length  top=length+1 bottom=0 * i=(top+1) 2 *4 entry$<>index$(i) i=_search(entry$) > H entry$=index$(i-1) i=i-1 R entry$<>index$(i-1) \ entry$=index$(i) =i =-i f : p : (z DO THE SEARCHING FOR FN_find_place  :  _search(entry$)  ' entry$>index$(i) bottom=i top=i " i=(top+bottom+1) 2: round % entry$=index$(i) top=bottom+1  =i ((22<<FFPPZZddnnxx"",,66@length  top=length+1 bottom=0 * i=(top+1) 2 *4 entry$<>index$(i) i=_search(entry$) > H entry$=index$(i-1) i=i-1 R entry$<>index$(i-1) \ entry$=index$(i) =i =-i f : p : (z DO THE SEARCHING FOR FN_find_place  :  _search(entry$)  ' entry$>index$(i) bottom=i top=i " i=(top+bottom+1) 2: round % entry$=index$(i) top=bottom+1  =i Track-Info  *  "+name$  name$=name$,2)  name$,1)<>" " =name$ ;  convlc(name$)  L%,A%,B$  L%=1 (name$) A%=(name$,L%))   A%<97 A%>64 A%=A%+32 B$=B$+(A%): L% =B$ (; 2 capital(name$) < A$ "Fname$=nospace(convlc(name$)) P (name$)<97 =name$ ZA$=((name$)-32) dA$=A$+name$,2) n=A$ x;  query(prompt$)  A$  ' prompt$;: A$:A$=capital(A$),1)  A$="Y" A$="N" =A$ HH H H66 \QDoes it fly\N2\Y3\ \QDoes it live in water\N9\Y8\ \QIs it an insect\Y5\N4\ \QIs it a mammal\Y7\N6\ \QDoes it have black stripes\Y37\N36\ \QIs it yellow\Y19\N18\ \Abat \QIs it a mammal\Y15\N14\ \QIs it an insect\Y11\N10\ \QIs it a mammal\N13\Y12\ \Aant \QDoes it have a long trunk\Y21\N20\ \QDoes it have a pouch\Y27\N26\ \QIs it a fish\N17\Y16\ \QIs it very big\N23\Y22\ \Agoldfish \QDoes it have a hard shell\Y29\N28\ \QDoes it have a red breast\Y25\N24\ \Acanary \QDoes it purr\Y33\N32\ \Aelephant \Awhale \QIs it furry\Y45\N44\ \QDoes it eat fish\Y31\N30\ \Arobin \QDoes it have eight legs\Y39\N38\ \Akangaroo \QDoes it have eight tentacles\N41\Y40\ \QIs its shell almost round\Y35\N34\ \QDoes it quack\Y49\N48\ \Aseagull \QDoes it eat ants\Y47\N46\ \Acat \Alobster \Acrab \Abee \Awasp \QDoes it have a forked tongue\N43\Y42\ \Aspider \Aoctopus \QDoes it have a nasty smell\Y53\N52\ \Asnake \Aworm \Adolphin \QDoes it build dams\N57\Y56\ \QDoes it bark\N51\Y50\ \Aanteater \Asparrow \Aduck \Adog \QDoes it have a lon :@%=10: 0: 15)"ANIMAL" 2 "Creative Computing Morristown New Jersey"'' ( by Nathan Teichholtz & Steve North 0( from an original idea by Arthur Luehrmann. 52 Modified by Chris Atkinson and Richard Russell. <: ,F =17 T~C ::" at line ";: PMAX=(-P)/40 Z A$(MAX) d "Play 'Guess the Animal'" n: xX=("ANIMAL.DAT") ( X<>0 read I=0 3: A$(I): I N=(A$(0)) : ***  MAIN CONTROL SECTION ***  9 query("Are you thinking of an animal ")="N" T~C K=1  question  A$(K),2)<>"\Q" 'A$=query("Is it "+art(A$(K),3))) 4 A$="Y" "Why not try another one?"'' new  ; " *** , NEW ANIMAL 6 *** @ new GJ "OK, I give up."'"Tell me what animal you were thinking"'"of ",V$ TV$=strip(convlc(V$)) <^ "Please tell me a question that would"'"distinguish "; 'h art(V$);" from ";art(A$(K),3)) r X$:X$=capital(X$) "| X$,1)="?" X$=X$,(X$)-1) 6A$=query("For "+art(V$)+" the answer would be ")  A$="Y" B$="N"  A$="N" B$="Y" Z1=(A$(0)) A$(0)=(Z1+2) A$(Z1)=A$(K) A$(Z1+1)="\A"+V$ 1A$(K)="\Q"+X$+"\"+A$+(Z1+1)+"\"+B$+(Z1)+"\"  ;  ***  PRINT QUESTIONS  ***  question Q$=A$(K) "C$=query(Q$,3,Q$,"\",3)-3)) &T$="\"+C$ 0X=Q$,T$,3) :Y=Q$,"\",X+1) DK=(Q$,X+2,Y-X-2)) N X; b *** l READ DATA FILE v ***  read % "Just let me refresh my memory" Z=0  #X,A$(Z):Z=Z+1  #X Z=MAX+1 A$(Z-1)=""  #X  ;  ***  PRINT NAME OF ANIMAL  ***  print  10*X);A$(I),3); X=(X+1) 4   ;  *** * LIST CONTENTS 4 *** > %H ' "Animals I already know are:" RX=0:I=0 \ I=I+1 f A$(I),2)="\A" print p A$(I)="" I=MAX )z ' "Room for ";((MAX-I)/3);" more." : query("Do you want to save these on disk")<>"Y" :  ***  DUMP FILE IF REQUESTED  *** % "ANIMAL.DAT" *ERA ANIMAL.DAT 2X="ANIMAL.DAT":Z=0: X=0 "Directory full":  # X,A$(Z):Z=Z+1  A$(Z)="" Z=MAX+1 # 0  ; 2 4,\QDoes it fly\N2\Y3\,\Agoldfish,\Asparrow, ; . NOW THE FUNCTIONS ; /$ art(noun$): Indefinite article appender ;. "AEIOUaeiou",noun$,1)) ="an "+noun$ ="a "+noun$ 8; &B strip(name$): Article stripper Lname$=nospace(name$) V AT$,Z ` tRD j Z=Z+1: AT$ t AT$=name$,(AT$)) Z=10 #~ Z<10 name$=name$,1+(AT$)) =nospace(name$) - A ,AN ,THE ,a ,an ,the ,An ,The ,THe ,, ;  nospace(name$) name$="Track-Info  * g neck\Y55\N54\ \Afrog \Atoad \QDoes it have antlers\Y59\N58\ \Agiraffe \Abeaver \Aotter \QDoes it like cheese\Y61\N60\ \Adeer \QDoes it like mud\Y63\N62\ \QCan it talk\Y65\N64\ \Arabbit \Ahippopotamus \Amouse \Aman bster \Acrab \Abee \Awasp \QDoes it have a forked tongue\N43\Y42\ \Aspider \Aoctopus \QDoes it have a nasty smell\Y53\N52\ \Asnake \Aworm \Adolphin \QDoes it build dams\N57\Y56\ \QDoes it bark\N51\Y50\ \Aanteater \Asparrow \Aduck \Adog \QDoes it have a lonIntroduction to the BBC BASIC Interpreter. Special Characters. Variables. Commands. Statements (except I/O). Print formatting. Input/Output Statements. Operating System Statements. Operators. Arithmetic Functions. String Functions. I/O and Special Functions. Pseudo-Variables. Error Codes. Indirection operators. Access to machine code. Assembler. Random access files. : INTRODUCTION TO BBC BASIC BBC BASIC is the language used on the "BBC Microcomputer", a 6502-based machine designed to accompany the BBC's Computer Literacy Project. This Z80 implementation has been designed to be as compatible as possible with the 6502 version, although it inevitably differs in some areas, notably input-output, and does not support the graphics and sound statements. A Z80 processor and CP/M version 2.2 or later are required; a minimum system size of 32K is recommended. For more information on BBC BASIC see the accompanying instruction manual and also the 520-page BBC Microcomputer "User Guide". Richard Russell March 1984 To run BBC BASIC, bring up CP/M and type the following: A>BBCBASIC The system will reply: BBC BASIC (Z80) V2.30 #00000 (C) Copyright R.T.Russell 1984 > Alternatively a filename may be given after BBCBASIC, in which case the system proceeds as if a CHAIN "filename" command had been typed after initialisation. A default extension of .BBC is used if none is supplied. : Special characters: ^E Delete a character ^A Insert a space ^H Backspace (cursor left) ^I Cursor right ^X Delete to beginning of line ^L Delete to end of line ^K Move cursor to start of line ^J Move cursor to end of line DEL Backspace and delete (the above characters are user-selectable) ^P Toggle printer ^S Pause display Terminates user input. Interrupt program execution, exit AUTO mode, abort EDIT command ! 32-bit indirection & Precedes hexadecimal constant ' New line in PRINT or INPUT * Precedes an "operating system" statement : Separates statements typed on the same line ; Introduce comment in assembler, suppress action in PRINT ? 8-bit indirection (PEEK & POKE) [ Enter assembler ] Exit assembler ~ Convert to hex (PRINT and STR$) : Variables: Variable names may be of unlimited length and all characters are significant. Variable names must start with a letter. They can only contain the characters A..Z, a..z, 0..9 and underline. Embedded keywords are allowed. Upper and lower case variable names are distinguished. The following types of variable are allowed: A real numeric A% integer numeric A$ string The variables A%..Z% are regarded as special in that they are not cleared by the commands or statements RUN, CHAIN and CLEAR. In addition A%, B%, C%, D%, E%, F%, H% and L% have special uses in CALL and USR routines and O% & P% have special meanings in the assembler (code origin and program counter respectively). The special variable @% controls numeric print formatting. The variables @%..Z% are called "static variables", all other variables are called "dynamic variables". Real variables have a range of approximately +-1E-38 to +-1E38 and numeric functions evaluate to 9 significant figure accuracy. Internally every real number is stored in 40 bits. Integer variables are stored in 32 bits and have a range of -2,147,483,648 to 2,147,483,647. StriTrack-Info  * e default error handling. Statement Syntax Function PROC PROCname[(parameter list)] Call a procedure. REM REM any text Remark REPEAT REPEAT Begin a REPEAT...UNTIL loop. REPORT REPORT Print error message for last error. RESTORE RESTORE [line] Reset data pointer to beginning or to specified line. RETURN RETURN Return from subroutine. RUN RUN Run the current program. STOP STOP Stop program and print message. Statement Syntax Function TRACE TRACE ON Start trace mode. TRACE OFF End trace mode. TRACE exp Trace lines less than exp. UNTIL UNTIL exp Terminate loop if exp is non-zero. WIDTH WIDTH exp Set terminal width. : Print Formatting By default, strings are printed left-justified and numbers are printed right-justified in a print zone. Numeric quantities will be printed left- justified if preceded by a semicolon (;). A comma (,) causes a tab to the beginning of the next print zone, unless the cursor is already at the start of a zone. An apostrophe (') in a PRINT or INPUT statement forces a new- line. A trailing semicolon in a PRINT statement suppresses the new-line. TAB(x), TAB(x,y) and SPC(n) may be used in PRINT and INPUT statements to position the cursor. A tilde (~) causes numbers to be printed in hex. The variable @% controls numeric formatting as follows: LS byte: Width of print zone, 0-255. Normally 10. Byte 2 : Number of significant figures or decimal places. Maximum 10. Byte 3 : Print format type: 0 - General format (default) 1 - Exponential format 2 - Fixed format. MS byte: STR$ flag. If zero then STR$ formats in G9 mode. If non- zero then STR$ formats according to bytes 2 & 3 of @%. Print formatting (continued) Examples Result @%=&2010A 01234567890123456789 PRINT "HELLO",8 HELLO 8.0 PRINT "HELLO" 8 HELLO 8.0 PRINT "HELLO";8 HELLO8.0 PRINT "HELLO",;8 HELLO 8.0 Value G9 ng variables may contain from 0 to 255 characters. All arrays must be dimensioned before use. All statements can also be used as direct commands. : Command Syntax Function AUTO AUTO [start][,inc] Generate line numbers. DELETE DELETE start,end Delete program lines. EDIT EDIT line Edit a program line. LIST LIST [line][,line] List all or part of program. LISTO LISTO number Control indentation in LIST. LOAD LOAD "filename" Load a program into memory. NEW NEW Delete current program & variables. OLD OLD Recover a program deleted by NEW. RENUMBER RENUMBER [start][,inc] Renumber the program lines. SAVE SAVE "filename" Save the current program to disk. : Statement Syntax Function CALL CALL address[,arg list] Call assembly language routine. CHAIN CHAIN string Load and run a program. CLEAR CLEAR Clear dynamic variables. CLS CLS Clear the screen. DEF DEF FNname[(arg list)] Define a function. DEF PROCname[(arg list)] Define a procedure. DIM DIM var(sub1[,sub2...])[,..] Dimension one or more arrays. DIM var exp [,var exp...] Reserve space for assembler etc. END END Terminate program and close files. ENDPROC ENDPROC Return from a procedure. FOR FOR var=exp TO exp [STEP exp] Begin a FOR...NEXT loop. Statement Syntax Function GOSUB GOSUB exp Call a BASIC subroutine. GOTO GOTO exp Branch to specified line. IF IF exp THEN stmts [ELSE stmt] Do statement(s) if exp non-zero. IF exp THEN line [ELSE line] Branch if exp non-zero. LET [LET] var = exp Assignment. LOCAL LOCAL var[,var...] Declare variables local to function or procedure. NEXT NEXT [var[,var...]] End FOR...NEXT loop. ON ON exp GOTO line,line.. [ELSE line] Computed GOTO. ON exp GOSUB line,line.. [ELSE line] Computed GOSUB. ON ERROR ON ERROR stmts Do statement(s) on error. ON ERROR OFF RestorTrack-Info  *  G2 E2 F2 @%=&90A @%=&20A @%=&1020A @%=&2020A .001 1E-3 1E-3 1.0E-3 0.00 .006 6E-3 6E-3 6.0E-3 0.01 .01 1E-2 1E-2 1.0E-2 0.01 .1 0.1 0.1 1.0E-1 0.10 1 1 1 1.0E0 1.00 10 10 10 1.0E1 10.00 100 100 1E2 1.0E2 100.00 1000 1000 1E3 1.0E3 1000.00 : Statement Syntax Function BPUT BPUT #chan,exp Write LS byte of exp to disk file. CLOSE CLOSE #chan Close disk file. IF chan=0 close all files. DATA DATA list Data for READ statement. INPUT INPUT ["prompt"[,]]var[,var] Request input from user. Comma after prompt causes question mark. INPUT LINE ["prompt.... As INPUT but accept whole line including commas, quotes etc. INPUT# INPUT #chan,var[,var...] Read data from disk file. Statement Syntax Function OSCLI OSCLI string Pass string to "operating system". PRINT PRINT [TAB(x[,y])][SPC(n)]['][;][~][exp[,exp...][;] Print data to console. PRINT# PRINT #chan,exp[,exp...] Write data to disk file. PUT PUT port,exp Output LS byte of exp to port. READ READ var[,var...] Read data from DATA statement(s). VDU VDU exp[,exp...] Send LS byte of exp to console. VDU exp;[exp;...] Send LS 16 bits of exp to console as two characters (LS byte first). : Statement Syntax Function *BYE *BYE Return to CP/M. *CPM *CPM Same as *BYE. *DIR *DIR [afn] List disk directory. *DRIVE *DRIVE d: Select d as current drive. *ERA *ERA afn Erase file(s). *LOAD *LOAD ufn aaaa Load file to hex address aaaa. *OPT *OPT 0 Console output via functions 2/6. *OPT 1 Console output to punch device. *OPT 2 Console output to printer. *OPT 3 Console output via function 6. *REN *REN ufn1=ufn2 Rename a file. Statement Syntax Function *RESET *RESET Reset the CP/M disk system. *SAVE *SAVE ufn ssss eeee Save RAM from hex address ssss to address eeee-1. *SAVE ufn ssss +llll Save RAM from address ssss with length llll. *TYPE *TYPE ufn Type file to console. afn=ambiguous filename, ufn=unambiguous filename, default extension is .BBC Operating system commands may be abbreviated and/or entered in lower case. A "star" command cannot contain variable names and must be the last item on a program line. To include a variable name use the OSCLI statement, e.g. to delete a file whose name is known only at run time: OSCLI "ERA "+filename$ : Operators Symbol Function + Addition or string concatenation. - Negation or subtraction. * Multiplication. / Division. ^ Involution (raise to power). NOT One's complement (integer). EOR Bitwise exclusive-OR (integer). OR Bitwise OR (integer). AND Bitwise AND (integer). MOD Modulus (integer result). DIV Integer division (integer result). = Equality. <> Inequality. < Less than. > Greater than. <= Less than or equal. >= Greater than or equal. The precedence of operators is: 1. Expressions in parentheses, functions, negation, NOT. 2. ^ 3. *,/,MOD,DIV 4. +,- 5. =,<,>,<>,<=,>= 6. AND 7. OR,EOR : Function Action ABS(exp) Absolute value of expression. ACS(exp) Arc-cosine of expression, in radians. ASN(exp) Arc-sine of expression, in radians. ATN(exp) Arc-tangent of expression, in radians. COS(exp) Cosine of radian expression. DEG(exp) Value in degrees of radian expression. EXP(exp) e raised to the power of expression. INT(exp) Largest integer less than expression. LN(exp) Natural logarithm of expression. LOG(exp) Base-ten logarithm of expression. Function Action RAD(exp) Radian value of expression in degrees. RND[(exp)] RNDTrack-Info  * nd returns channel no OPENOUT(str) Opens file for output and returns channel number. OPENUP(str) Same as OPENIN PI Returns 3.14159265. POS Returns current cursor column (LHS=0). TOP Returns first address after end of user's program. TRUE Returns -1. USR(address) Calls machine-code routine and returns integer. VPOS Returns current cursor line (top line=0). : Pseudo-variables Pseudo-variables allow the user both to read and modify system variables. They may be used either side of an assignment statement, e.g. TIME=TIME+50 (but note that LET is not permitted). Name Function PAGE Memory address of current user's program. PAGE is always a multiple of 256. PTR#chan File character pointer. Allows random access. HIMEM Top of memory used by BASIC. LOMEM Start address of dynamic variable storage. TIME Elapsed time clock, counts in centiseconds. : Error codes Direct Mode Only (error code 0): Silly RENUMBER space LINE space Disastrous and untrappable: Bad program No room Sorry Trappable: 1 Out of range 4 Mistake 5 Missing , 6 Type mismatch 7 No FN 9 Missing " 10 Bad DIM 11 DIM space 12 Not LOCAL 13 No PROC 14 Array 15 Subscript 16 Syntax error 17 Escape 18 Division by zero 19 String too long 20 Too big 21 -ve root 22 Log range 23 Accuracy lost 24 Exp range 26 No such variable 27 Missing ) 28 Bad HEX Trappable errors (continued) 29 No such FN/PROC 30 Bad call 31 Arguments 32 No FOR 33 Can't match FOR 34 FOR variable 36 No TO 38 No GOSUB 39 ON syntax 40 ON range 41 No such line 42 Out of DATA 43 No REPEAT 45 Missing # 190 Directory full 192 Too many open files 196 File exists 198 Disk full 200 Close error 204 Bad name 214 File not found 222 Channel 253 Bad string 254 Bad command 255 CP/M Error (CP/M 3 only) : Indirection operators Indirection is the process which is provided by PEEK and POKE in other dialects of BASIC. There are three indirection operators: returns random 32-bit integer. RND(-n) seeds sequence. RND(0) repeats last value in RND(1) form. RND(1) returns number between 0 and 0.999999999 RND(n) returns random integer between 1 and n. SGN(exp) 1 if exp>0, 0 if exp=0, -1 if exp<0. SIN(exp) Sine of radian expression. SQR(exp) Square root of expression. TAN(exp) Tangent of radian expression. : Function Action ASC(str) Returns ASCII value of first character of string. Returns -1 if null string. CHR$(exp) Returns one-character string with ASCII value of exp. EVAL(str) Evaluates str as an expression and returns resulting number or string. GET Waits for keypress and returns ASCII value. GET$ Waits for keypress and returns one-character string. INKEY(exp) Waits exp centiseconds for keypress and returns ASCII value. If no keypress then returns -1. INKEY$(exp) Waits exp centiseconds for keypress and returns one-character string. If no keypress returns null string. INSTR(r,s[,n]) Returns position of string s in string r, optionally starting at position n. Function Action LEFT$(str,exp) Returns leftmost exp characters of string. LEN(str) Returns length of string (0-255). MID$(str,m[,n]) Returns sub-string from position m, of length n or to end. RIGHT$(str,exp) Returns rightmost exp characters of string. STR$[~](exp) Returns string representation of exp in decimal (or hex). STRING$(n,str) Returns a string consisting of n copies of str. VAL(str) Returns numeric value of str. IF str does not begin with a signed or unsigned numeric constant, VAL returns zero. : Function Action BGET#chan Returns a single byte from a disk file. COUNT Number of characters printed since last new line. EOF#chan Returns TRUE if disk file is at its end. ERL Line number of last error. ERR Code of last error. EXT#chan Returns virtual length of disk file. FALSE Returns zero. FNname[(parameter list)] User-defined numeric or string function. GET(port) Returns contents of Z80 port. Function Action OPENIN(str) Opens file for input/update aTrack-Info  *  Name Purpose No. of bytes affected ? query byte indirection operator 1 ! pling word indirection operator 4 $ dollar string indirection operator 1 to 256 Y=PEEK(X) is equivalent to Y=?X POKE X,Y is equivalent to ?X=Y ! acts on four successive bytes. For example, !M=&12345678 would load &78 into address M, &56 into address M+1, &34 into address M+2 and &12 into address M+3. $ writes a string, followed by carriage return, into memory at a specified address, e.g. $M="ABCDEF" will place the ASCII characters A to F in locations M to M+5 and will load &0D into address M+6. Indirection operators (continued) Query (?) and pling (!) can also be used as binary operators, e.g. M?3 means "the contents of memory location M+3". The left-hand operand must be a variable, not a constant. The power of indirection operators is in the way they can be used to create your own data structures. For example you may need a structure consisting of a 10 character string, an 8-bit number and a reference to a similar structure. If M is the address of the start of the structure then: $M is the string M?11 is the 8-bit number M!12 is the address of the related structure. In this way you can create and manipulate linked lists and tree structures in memory, very easily. : Access to machine code The USR function and the CALL statement provide a flexible interface between BASIC and machine-code routines. Both USR and CALL initialise the Z80's registers prior to the machine-code call as follows: A register = LS byte of A% F register = LS byte of F% B register = LS byte of B% C register = LS byte of C% D register = LS byte of D% E register = LS byte of E% H register = LS byte of H% L register = LS byte of L% IY register = address of machine-code routine (=PC) IX register = address of parameter block (CALL statement only) USR(address) Calls the machine-code routine and returns a 32-bit integer made up of the contents of the H,L,H' and L' registers (most- significant to least-significant) on return from the routine. Access to machine code (continued) CALL address[,parameter list] Sets up a parameter block containing the following information: Number of parameters - 1 byte Parameter type - 1 byte ) repeated as often Parameter address - 2 bytes ) as necessary. Parameter types are as follows: 0: 8-bit quantity (e.g. ?X) 4: 32-bit integer variable (e.g. !X or X%) 5: 40-bit floating-point variable (e.g. V) 128: a fixed string (e.g. $X, terminated by &0D) 129: a string variable (e.g. A$) In the case of a string variable, the parameter address is the address of a String Descriptor containing start address, current length of string and number of bytes allocated. Parameters are passed by reference and may be changed by the machine-code routine. : Assembler BBC BASIC includes a full assembler for the appropriate host processor, in this case the Z80. It is an in-line assembler which loads its object code directly into the target memory area; the static variable P% is the program counter. Error reporting and listing are controlled by the pseudo-op OPT as follows: OPT 0 Inhibits error reporting and gives no listing. OPT 1 Inhibits error reporting but gives a listing. OPT 2 Reports errors but gives no listing. OPT 3 Reports errors and gives a listing. OPT 4 As OPT 0 but puts code at O% rather than P%. OPT 5 As OPT 1 but puts code at O% rather than P%. OPT 6 As OPT 2 but puts code at O% rather than P%. OPT 7 As OPT 3 but puts code at O% rather than P%. Normally the first pass of the assembler will be with OPT 0 and the second pass with OPT 2 (if no listing is required) or OPT 3 (if a listing is required). Do not confuse the pseudo-op OPT with the Operating System Statement *OPT. Pseudo-ops accepted by the assembler are DEFB, DEFW and DEFM; these write an 8-bit byte, a 16-bit word and a multi-character string respectively. Example of use of assembler: 100 DIM code 15 :REM Reserve space for 16 bytes of code 110 bdos=5 120 FOR pass=0 TO 1 :REM Implement 2-pass assembly 130 P%=code :REM Set program counter at start of each pass 140 [OPT pass*3 ;Enter assembler and select listing on pass 2 150 LD D,95:LD E,ASC"!" 160 .loop ;A label 170 LD C,2 ;Source statements 180 PUSH DE:CALL bdos:POP DE 190 INC E:DEC D:JR NZ,loop 200 RET:] :REM Exit assembler 210 NEXT pass 220 CALL code :REM Execute assembly language routine In this particular example a single pass would have sufficed asTrack-Info  * file ar o tw basi type -- indexe an non-indexed. Indexe file ar thos .HL file whic star wit a index Thi i a exampl o a indexe file Whe HEL load a indexe file i display thi inde t th use an allow hi t selec entrie fro it Th use ma selec a man entrie a h desire i an orde h desire b simpl typin th lette o hi selection Onc th use ha mad hi selection hel wil loo u th bod o tex h selecte an displa i t hi i page mode Whe th use ha finishe readin hi selection HELР the return hi t th inde menu Typin Control- wil retur th use t CP/M. Non-indexe file ar thos .HL file whic d no star wit a index I suc cases HEL wil immediatel displa th content o th fil t th use and whe th use ha finishe lookin a it HEL wil retur t CP/M. HEL i menu-driven an al th command availabl t th use a an give tim ar displaye t him HEL ca b ver usefu too fo on-lin referenc t th user It i conjunctio wit th man HL file no available ha alread prove t be of significant value. Richard Conn :HELP: How to use the HELP Command Th HEL Comman i execute i on o thre ways: (1) by just typing 'HELP' (2) by typing 'HELP FILENAME', where FILENAME is the name of a disk file named FILENAME.HLP (3) by typing 'HELP FILENAME.EXT', where FILENAME.EXT is the name of a file created in the format of a help file I th use type jus 'HELP' h wil receiv th HELP.HL hel fil (no bein displaye t you) Fo al othe form o th HEL command th use wil se th specifie hel fil information Generall speaking th nam o th hel fil shoul b indicativ o it subject lik CPM.HL shoul contai hel informatio o CP/M. :HELP: How to write .HLP files File use b th HEL progra ar eithe simpl CP/M-standar file o栠 ASCIɠ tex o ASCIɠ file generate b th Wor䠠 Sta tex editor/formatter Thes files a mentione above ar o tw basi types indexe an non-indexed an eac typ i relate t th othe an i o th sam basi format Grouping of Information Informatio displaye t th use i groupe b th inde there are no "forward references". : Random access files BBC BASIC supports both random access and the ability to modify (update) a previously written disk file. Random access is performed by a single pointer (PTR#chn) which can be positioned anywhere in the file. The pointer is automatically incremented after every read or write operation (using BGET#, BPUT#, INPUT# or PRINT#). Examples: 100 REM Read a file backwards 110 fin=OPENIN(filename$):size=EXT#fin 120 FOR point=size-1 TO 0 STEP -1 130 PTR#fin=point : PRINT CHR$(BGET#fin); 140 NEXT : CLOSE #fin 100 REM Update a "record" in a random-access file 110 fin=OPENUP(filename$) 120 PTR#fin=record_number*record_length 130 PRINT #fin,new_data,new_data$ 140 CLOSE #fin  Welcome to the HELP Command How to use the HELP Command How to write .HLP Files Help on CP/M in general :HELP: Welcome to the HELP Command Welcom t th HEL Command Th HEL Comman i designe t assis you th CP/͠ user i th us o CP/ i genera an specifi CP/ command i particular I i designe a a interactive on-lin assistanc system. HEL pull i file name .HL fro dis an display thes t th use i page mode Thes Track-Info  *  i indexe HLР file an ma als b groupe b line beginnin wit For Fee (^L characters Groupin i a effectiv wa t logicall organiz informatio s tha meanin wil b mor clea t th use an unit o informatio will not pass between screen displays. Non-Indexed .HLP Files Non-indexe .HL file ar simpl ASCI file whic star wit colo (: a th firs characte o th fil an consis o ASCI tex (wit eac lin terminate b carriag return/lin fee characte combination) Th informatio i suc hel fil consist o al tex afte th leadin colo u t eithe th terminatin end-of-fil mar (control-Z o ne lin whic start wit colon. Indexed .HLP Files Indexe .HLР file ar simpl ASCI file whic d no star wit colo (: a th firs characte o th file Thi typ o .HLР fil consist o on o mor norma ASCI tex line a th firs line o th fil followe b informatio section whic begi wit lin whos firs characte i colo an en wit eithe th firs lin o th nex informatio sectio o th en o th file. :HELP: General Information on CP/M CP/ i monito contro progra fo microcompute syste developmen whic use IBM-compatibl flexibl disk (flopp disks fo mas storage Usin microcompute mainfram base o Intel' 808 o Zilog' Z8 microprocessor CP/͠ provide genera environmen fo progra construction storage an editing alon wit assembl an progra debu facilities A importan featur o CP/ i tha i ca b easil altere t execut wit an compute configuratio whic use a Inte 808 o Zilo Z8 Microprocesso an ha a leas 16 byte o mai memor wit u t fou IBM-compatabl diskett drives. Th CP/ monito provide acces t program throug comprehensiv fil managemen system Th fil subsyste support name fil structure allowin dynami allocatio o fil spac a wel a sequentia an rando fil access Usin thi fil system u t 6 distinc program ca b store i bot sourc an machine-executabl form. Digita Research th designe o CP/M ha provide se o si manual whic describ th us an operatio o CP/ i detail. These manuals are: 1 A Introductio t CP/ Feature an Facilities 2. ED: A Context Editor for the CP/M Disk System 3. ASM: CP/M Assembler User's Manual 4 DDT CP/ Dynami Debuggin Too User' Manual 5. CP/M Interface Guide 6. CP/M System Alteration Guide A th reade ca see CP/ support contex editor a assemble (Intel-compatable) an debugge system Thes ar availabl i th basi CP/ package Ther i larg variet o othe softwar availabl whic ca ru unde CP/ wit littl o n modification Suc softwar include severa assembler (bot 808 an Z80) symboli debugger severa high-leve language (includin FORTRAΠ I֠ {compiler} BASIC- {translator} CBASI {translator} man interpretiv BASICs ALGOL FOCAL an C) an severa special-purpos application program (suc a tex formattin system an accountin systems). Refe t th indicate manual and/o th CP/ hel fil fo furthe information. 80) symboli debugger severa high-leve language (includin FORTRAΠ I֠ {compiler} BASIC- {translator} CBASI {translator} man interpretiv BASICs ALGOL FOCAL an C) an severa special-purpos application program (suc a tex formattin system an accountin systems). Refe t th indicate manual and/o th CP/ hel fil fo furtTrack-Info  *  --> FILE: CRC .COM CRC = 12 C3 --> FILE: BBCBASIC.COM CRC = 00 46 --> FILE: UNLIST .COM CRC = 91 18 --> FILE: CONVERT .COM CRC = 6F FA --> FILE: RUN .COM CRC = 00 00 --> FILE: HELP .COM CRC = 63 B9 --> FILE: MERGE .BBC CRC = 07 3F --> FILE: SORT .BBC CRC = 54 C1 --> FILE: F-RSER2 .BBC CRC = 93 54 --> FILE: F-WSER1 .BBC CRC = 4D E6 --> FILE: F-WSTD .BBC CRC = 64 73 --> FILE: F-WSER2 .BBC CRC = A9 BF --> FILE: F-RAND1 .BBC CRC = 2A A3 --> FILE: F-WESER1.BBC CRC = AF C0 --> FILE: F-WESER2.BBC CRC = 8B 30 --> FILE: F-RSTD .BBC CRC = 35 14 --> FILE: F-RSER1 .BBC CRC = C1 63 --> FILE: F-RAND0 .BBC CRC = 98 C5 --> FILE: F-RAND2 .BBC CRC = 3D 82 --> FILE: F-INDEX .BBC CRC = 88 B5 --> FILE: ANIMAL .BBC CRC = 53 35 --> FILE: ANIMAL .DAT CRC = BD 25 --> FILE: BBCBASIC.HLP CRC = F9 F1 --> FILE: HELP .HLP CRC = 95 1B --> FILE: SETTIME .BBC CRC = C2 18 --> FILE: SORTREAL.BBC CRC = FA 50 --> FILE: READ .ME CRC = 05 tin 7  0 " THIS PROGRAM SETS THE REAL TIME CLOCK"'' +( "You will be asked for the time in:"' 2 " Hours hh (0 TO 23)" < " Minutes mm (0 TO 59)" !F " Seconds ss (0 TO 59)"' 'P "Push after each entry."' 9Z "The time will be set when you enter the seconds."' d nok= x  "Hours "hours  "Minutes "mins  "Seconds "secs # (hours)<>hours _err("hour") ' hours>23 hours<0 _err("hours") ! (mins)<>mins _err("mins") $ mins>59 mins<0 _err("mins") $ secs>59 secs<0 _err("secs") ! (secs)<>secs _err("secs") ok= hours$=(hours) # (hours$)=1 hours$="0"+hours$ mins$=(mins)  (mins$)=1 mins$="0"+mins$ secs$=(secs)  (secs$)=1 secs$="0"+secs$ "$tin=hours$+mins$+secs$ , I=0 5 6?(&FB8C+I)=?(tin+I) @ $J ''"The time has been set to:"' Tt$=$ .^ " "+t$,2)+":"+t$,3,2)+":"+t$,2) h r: | _err(err$)  "Bad "+err$+" format.";  " Try again please" ok=  (( Track-Info  * C2 C1 63 --> FILE: F-RAND0 .BBC CRC = 98 C5 --> FILE: F-RAND2 .BBC CRC = 3D 82 --> FILE: F-INDEX .BBC CRC = 88 B5 --> FILE: ANIMAL .BBC CRC = 53 35 --> FILE: ANIMAL .DAT CRC = BD 25 --> FILE: BBCBASIC.HLP CRC = F9 F1 --> FILE: HELP .HLP CRC = 95 1B --> FILE: SETTIME .BBC CRC = C2 18 --> FILE: SORTREAL.BBC CRC = FA 50 --> FILE: READ .ME CRC = 05 e Introduction to the Einstein DOS/MOS Introduction, and type the following: A>BBCBASIC After a couple of seconds, the system will reply: Einstein BBCBASIC Version 2.31 (C) Copyright R.T.Russell 1984 > 7. Alternatively a filename may be given after BBCBASIC, in which case the system proceeds as if a CHAIN"filename" command had been typed after initialisation. A default extension of .BBC isREAD.ME 18 Oct 84 EINSTEIN BBCBASIC (Z80) 1. The READ.ME file is includes brief instructions on running BBCBASIC(Z80) and gives any hints and tips which have come to light since the manual was written. 2. The Einstein version of BBCBASIC(Z80) is supplied on a 3" compact floppy disk. It runs under the Tatung/Xtal DOS (Disk Operating System). The name of the file is BBCBASIC.COM. 3. Einstein BBCBASIC(Z80) is fully configured for the Einstein and all the statements and functions specified for BBCBASIC are available. It has been designed to be as compatible as possible with the 6502 version resident in the BBCMicro. However, the difference in the hardware, particularly in the area of graphics and sound, makes full compatibility impossible and programs which explore the full capabilities of the BBC Micro in these areas will not run on the Einstein without modification. In addition, any machine code routines will need to be converted from 6502 to Z80 assembler code. The language syntax is not always completely identical to that of the 6502 version, but in most cases the Einstein version is more tolerant (For example, both a comma and a semi-colon are accepted after the prompt string in an INPUT statement). 4. To run BBCBASIC, place your BBCBASIC(Z80) working disk in drive 0: bring up the DOS as described in the Introduction to the Einstein DOS/MOS Introduction, and type the following: A>BBCBASIC After a couple of seconds, the system will reply: Einstein BBCBASIC Version 2.31 (C) Copyright R.T.Russell 1984 > 7. Alternatively a filename may be given after BBCBASIC, in which case the system proceeds as if a CHAIN "filename" command had been typed after initialisation. A default extension of .BBC isTrack-Info  *  used if none is supplied. This feature allows BASIC programs to be executed in batch mode. HINTS AND TIPS 8. No additional information of interest has come to light since the manual was written. sell 1984 > 7. Alternatively a filename may be given after BBCBASIC, in which case the system proceeds as if a CHAIN "filename" command had been typed after initialisation. A default extension of .BBC isTrack-Info  * Track-Info  * Track-Info  * Track-Info  *          Track-Info ! *!!!!!!!!!! Track-Info " *""""" """""Track-Info # *########## Track-Info $ *$$$$$ $$$$$Track-Info % *%%%%%%%%%% Track-Info & *&&&&& &&&&&Track-Info ' *''''''''''