home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14684 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.5 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!haven.umd.edu!ni.umd.edu!zben-mac-ii.umd.edu!user
  3. From: zben@ni.umd.edu (Charles B. Cranston)
  4. Subject: Re: updating window text / getting text lines from buffer
  5. Message-ID: <zben-280892150237@zben-mac-ii.umd.edu>
  6. Followup-To: comp.sys.mac.programmer
  7. Sender: usenet@ni.umd.edu (USENET News System)
  8. Nntp-Posting-Host: zben-mac-ii.umd.edu
  9. Organization: UM Home for the Terminally Analytical
  10. References: <86967@netnews.upenn.edu> <1992Aug25.232449.12720@kronos.arc.nasa.gov>
  11. Date: Fri, 28 Aug 1992 19:08:26 GMT
  12. Lines: 28
  13.  
  14. In article <1992Aug25.232449.12720@kronos.arc.nasa.gov>,
  15. joshr@kronos.arc.nasa.gov (Joshua Rabinowitz-Summer-91) wrote:
  16.  
  17. > ...  there is a method of reading from 
  18. > a file documented somewhere in IM for getting the filemanager to
  19. > parse files into lines delimited by any desired char ('\n' in this case)
  20.  
  21. > If anyone has written a code snippet that does this, pls. inform me
  22. > as to how this is done.  Posting here is okay, but mailing me a code snippet
  23. > would be godly.
  24.  
  25. var
  26.     junk:    Integer;
  27.     Buff:    Packed Array[0..255] of SignedByte;
  28.     PBRec:    ParamBlockRec;
  29. begin        
  30.     PBRec.ioRefNum := theFile;
  31.     PBRec.ioBuffer := @Buff;
  32.     PBRec.ioPosMode := $0D80;  <<----80 is read till EOL bit, 0D is CR!
  33.     PBRec.ioPosOffset := 0;
  34.     PBRec.ioReqCount := 256;
  35.     junk := PBReadASync(@PBRec);
  36.     UseText(PBRec.ioActCount,@Buff);
  37.  
  38. Yipe, I figured this out so long ago I was still doing Pascal...
  39. Bear skins and stone knives...
  40.  
  41. zben@ni.umd.edu     -KA3ZDF
  42.