Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!ncar!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: How do you get the NewLine mode to work? Message-ID: <18094@unix.SRI.COM> Date: 9 Nov 90 19:27:58 GMT Reply-To: mxmora@sri-unix.sri.com (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 44 Keywords:Newline,Filemanager,PBread I'm trying to get the newline mode to work with PBread but I am having no luck. in IM it states: "Note: Advanced programmers: Bit 7 of ioPosmode is the newline flag; it's set if read operations should terminate at a newline character. The ASCII code of the newline character is specified in the high-order byte of ioPosMode. If the newline flag is set, the data will be read, one byte at a time unitl the newline character is encountered, ioReqCount bytes have been read, or the end-of-file is reached." This is what I tried : posmode := $0D00; {set the highorder byte to CR } BitSet(@PosMode, 0); {set bit 7 } while error = noerr do begin with myPB do begin ioCompletion := nil; ioRefNum := refnum; ioBuffer := buf^; ioReqCount := 100; {set to 100 because CR is before 100 bytes } ioPosMode := PosMode; {in the test file } end; error := PBRead(@mypb, false); After the read, myPB.ioActCount = 100 and buf is filled with 100 bytes of data. What the hell am I doing wrong? Thanks -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________