Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!hsdndev!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: writing a text file Message-ID: <23578@unix.SRI.COM> Date: 24 Apr 91 20:12:14 GMT References: <1991Apr24.074449.1148@uokmax.ecn.uoknor.edu> Reply-To: mxmora@unix.sri.com (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 35 In article <1991Apr24.074449.1148@uokmax.ecn.uoknor.edu> kpmiller@uokmax.ecn.uoknor.edu (Kent P Miller) writes: >Ok. Here's another one of my patented Stupid Questions (tm). > >I need to pump a few lines of text to a file. So, I'm looking through IM and >it says >FSWrite(refNum:integer; var count:longint; buffPtr:Ptr):OSErr; > >I wouldn't know a buffPtr if it bit me on the butt. What is it, and where can >I go to purchase one? A "buffPtr" is a pointer to a buffer of data. If your data is in a pascal string then you could do something like this: count:=length(mystring); error:=FSWrite(refNum, count, ptr(ord(@mystring)+1)); In the example above, we are passing the pointer of a string 1 byte passed the length byte of the string. If your data is/are in a TERecord then you could do this: count:=MyTERec^^.teLength; {set the length of the data} error:=FSWrite(refNum, count, ptr(MyTERec^^.hText^)); That should write what was in MyTErec in to the file. -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________