home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pgnode / node2 / n-read.do < prev    next >
Text File  |  2006-10-19  |  1KB  |  42 lines

  1. N-READ.CO by Paul Globman (c) 1990
  2. ----------------------------------
  3.  
  4. N-READ.CO allows a BASIC program to have sequential access to TEXT files in 
  5. Node RAM without having to move the entire file into T200 RAM.
  6.  
  7. Your BASIC program must first:
  8.  
  9.          LOADM "N-READ"
  10.  
  11. Then the following calls are available:
  12.  
  13.  
  14. CALL63600,0  closes any previously opened file in Node.
  15.  
  16. CALL63600,1,VARPTR(X$) opens file X$ in Node if no files are open, else closes
  17. opened file, beeps, and returns.
  18.  
  19. CALL63600,2,VARPTR(X$) reads bytes from opened Node file and returns with data
  20. in X$.  The read begins where previous read ended and stops at CRLF or 255 
  21. bytes, whichever occurs first.
  22.  
  23. PEEK(63603) examines result descriptor.  This location holds 1 if the OPEN or
  24. READ was sucessful.  If this is not 1 after an OPEN then file was not found.
  25. If this is not 1 after a read then EOF was found.  Upon encountering an EOF
  26. condition after a read, examine LEN(X$) to determine if valid data was 
  27. encountered prior to EOF.
  28.  
  29.  
  30. To implement N-READ.CO in your application program, study (and run)
  31. this READ TEST PROGRAM.
  32.  
  33. 0 REM READ TEST PROGRAM (c) P.GLOBMAN
  34. 10 LOADM"N-READ":INPUT"file";X$
  35. 20 CALL63600,1,VARPTR(X$)  ' OPEN FILE
  36. 30 IFPEEK(63603)=1THEN50   ' TEST OPEN
  37. 40 PRINT"File not found":GOTO10
  38. 50 CALL63600,2,VARPTR(X$)  ' GET INPUT
  39. 60 IFPEEK(63603)=1THENPRINTX$:GOTO50
  40. 70 IF X$<>""THENPRINTX$;   ' TEST EOF
  41. 80 END
  42.