# > BLib.BBCFile 1.00 12Feb1992 2 Read and write BASIC data using fast file IO : (< Note! These routines are actually *slower* than PRINT# 2: and INPUT# on all filing systems other than NFS 3.xx <: F: P5 PROCBBC_WrStr(out%,str$) - write string to file Z, On entry: out% - handle to output file d& str$ - string to write n6 ------------------------------------------------ x7BBC_WrStr(O%,A$): L%:L%=A$:data%?0=0:data%?1=L% 1 L%: A%=2 L%+1:data%?A%=A$,L%-A%+2,1): gbpb(2,O%,data%,L%+2,0): : : 6 PROCBBC_WrInt(out%,int%) - write integer to file , On entry: out% - handle to output file ' int% - integer to write 6 ------------------------------------------------ BBC_WrInt(O%,I%) Jdata%!4=I%:data%?3=data%?5:data%?2=data%?6:data%?1=data%?7:data%?0=&40 gbpb(2,O%,data%,5,0): : : 4 PROCBBC_WrReal(out%,real) - write real to file , On entry: out% - handle to output file * real - real value to write "7 ------------------------------------------------- ,0BBC_WrReal(O%,R):#O%,R:: Needs updating 6: @: J, PROCBBC_Rd(in%) - read value from file T+ On entry: in% - handle to input file ^C On exit: Reads the next item and returns int, real or string h4 if next item unrecognised, returns 0 rC ------------------------------------------------------------- |"ݤBBC_Rd(I%): R,L%,A$:A%=#I% Y A%=0:L%=#I%: L%:gbpb(4,I%,data%,L%,0):L%=L%-1:A$=A$+data%?L%:L%=L%-1:L%<0:=A$ b A%=&40 A%=1:gbpb(4,I%,data%,4,0):data%?4=data%?2:data%?5=data%?1:data%?6=data%?0:=data%!3 3 A%>&7F:#I%=#I%-1:#I%,A:=A: Needs updating =0 :