#ô > BLib.BBCFile 1.01 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ô ------------------------------------------------ x7ÝòBBC_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ô ------------------------------------------------- ,ÝòBBC_WrReal(O%,A) 6 ç £ Œ @ ñ#O%,A:á JÍ T3?data%=&FF:|(data%+1)=A:ògbpb(2,O%,data%,6,0):á ^: h: r,ô PROCBBC_Rd(in%) - read value from file |+ô On entry: in% - handle to input file †Cô On exit: Reads the next item and returns int, real or string Cô ------------------------------------------------------------- š"ݤBBC_Rd(I%):ê L%,A$,A:A%=š#I% ¤ç A%=0:L%=š#I%:ç L%=0:="" ®Lç A%=0:ò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 Â ç £ Œ ÌÏ#I%=#I%-1:è#I%,A:=A ÖÍ à!ògbpb(4,I%,data%,5,0):=|data% ÿ