P734 CEEFAX 734 Mon 10 Nov 21:18/35 |B2201204|b17FBuildT|j13BBC|l43000|s—:8 |p÷e DISK NUMBER : DISKCA TJGORZ : DISC÷e FILENAMEFBUIL D-T÷e ÷e ÷e MACHIVE  BBC B/B+/Master÷e BASIC AOSADOSPERIPHERALS Disc Drives÷e TAPE COMPATIBILITY No÷e ÷e ÷e LIVEVUMBER 20000-20290÷e NAME PROCF#B ld÷e AUTHOR JM REFERENCE RAR s÷e ÷e CLASSIFICATION DR om Access÷e DESCRJPTJON B random access jile of records÷e÷a÷a  ready for use bz the other procedures÷ e PARAM ETERS REQUIRED T n "y a set of÷e  DATA#T for this file.÷e DATA#T e maximum numbjt of record needed. ÷e A ÷e M
P734 CEEFAX 734 Mon 10 Nov 21:21/17 |B2202204|aQ7FBujldT|j13BBC|l434EF|s—:8 |p 999.÷e DATA#T number of fields per record. Can÷e bj any number, but max of 20 is assume d÷e  ties.÷e DATAS 1-5 which proceeds each÷e  number and makes record numbers÷e  unique over several files.÷e DATA *,lin%.. Set of integers giving the lung th of÷e  1st field÷e  number. Total÷e  st bj less than 255 as÷e  d as a basic string.÷e÷e PARAMETERS RETURNED GLOBALVAR IABLES REFERENCED None÷e GLOBAL VA RJABLES AFFECTED None÷e ÷e M ODE DEPENDENCE N OTHER MODULES CALLED NOTHER MODS-ES RELATED FINITFREAD F.WRJTJ÷e ÷e COMMENTS T is procedure is only used to initial|c
P734 CEEFAX 734 Mon 10 Nov 21:21/14 |B2203204|aQ7FBuildT|i13BBC|l4396F|s—:8 |ply÷e A ixed record format,÷e  th a 4 digit unique record÷i  r is used. An integer(last%) and a÷e text string with details of the recor d÷e  wed bz÷e  ole text string.÷e S ke some time to run, the÷e  numbers are displayed as they are÷e written to show progress.÷e  TYPICAL CALL AND LISTING÷e÷e 10 REM Build a new file÷e 20 REM File Name, Max number of records, No of fields per record, file#id÷e 30 DATA test,100,5,1 ÷e 40 REM Length of fields. Qst Field is record number and must bj length 4÷e 50 DATA 4,8,7,9,8÷e 60 :÷e 70 REST ORE 30÷e 80 PROCF#Build÷e 90 END÷e 100 :÷e20000 REM *********************** ******÷e40010 REM * REM Random File Build *÷e20030 R|c
P734 CEEFAX 734 Mon 10 Nov 21:27/41 |B2204204|bQ7FBujldT|j13BBC|l43DE5}s—:8 |pJM * (c) 1986 J. Meets *÷e20040 REM * Prestel Mailbox 707327277 *÷e20050 REM * REM ***********************÷e20070 :÷e20080 DEF PROCF#Build÷e20090 LOCAL i%,max%,fld *,rec#lin%,file%,F$,H$,h$,R$÷e20100 CLS÷ e20110 READ F$,max%,jld%,file%÷e20120 RE M Now store field lengths as text header ÷e20140 H$="":rec#len%=0÷e20150 FOR i%=1 TO fld%÷e20160 READ h$:rec#len%=rec#l en*+VAL(h$)÷e20170 H$=H$+RIGHT$(" "+h$ ,2)÷e20180 NEXT÷e20190 REM Write the r ecords to the file÷e20200 x%=OPENOUT F$÷ e20210 PRINT£x%,1000*file%+max%,H$÷e2022 0 FOR i%=0 TO max%÷e20230 PRJNTTAB(10, 10)i%:REM Show record number being wrist en÷e20240 R$=STU$(file%*1000+i%)+STRJN G$(rec#len%-4,".")÷e20250 PRINT£x%,R$÷ e20260 NEXT÷e20270 CLOSE£x%÷e20280 END PROC÷e20290 :÷e|c
P734 CEEFAX 734 Mon 10 Nov 21:12/13 |B2201202|a15FInit|j24BBBC332k|l43000|p÷ e20300REM *****************************÷ e20310RJM * *÷ j20320RJM * Random File Initialisj *÷ e20330REM * (c) 1986 J. Meets *÷ e40340REM * Prestel Mailbox 707327277 *÷ e20350RJM * *÷ e20360REM *****************************÷ e20370:÷e20380REM Open & Initialisj file system÷e20390REM F$=File name÷e20400REM rw=1 read only, rw=2 read/write÷e40410: ÷e20420DEF PROCF#Init(F$,rw)÷e20430LOCAL max#flds÷e20440REM GLOBAL R%, Rmax%, rw %÷e20450REM GLOBAL#ARRAYS R$, len*÷e204 60REM Set up key to display stored recor ds÷e20470*KEY5 F.i%=0TORmax%:IFLEFT$(R$( i%),1)<>" "THENP.R$(i%):N.ELSEN.||M÷e204 80REM Arrays for length of fields and re cords in memory÷e20490max#flds=20:DIM le n*(max#flds)÷e20500Rmax%=20:DIM R$(Rmax% )÷e20510rw%=rw:REM Set read/write flag÷e 20520PROCF#param(F$)÷e40530ENDPROC÷e2054 0:÷e20550DEF PROCF#param(N$):LOCAL i|c
P734 CEEFAX 734 Mon 10 Nov 21:17/44 |B2202202|a15FInit|j24BBBC332k|l43352|p% ,x%,H$÷e20560REM GLOBAL handle%,last%÷e2 0570handle%=OPENIN N$÷e20580INPUT£handle %,last%,H$÷e20590REM Get the field lings hs÷e20600len*(0)=1÷e20610FOR i%=1 TO LEN (H$)/2:len*(i%)=VALMID$(H$,2*i%-1,2):oEX T÷e20620ENDPROC÷e20630:÷e|c