Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!cci632!ritcsh!ultb!ritvax.isc.rit.edu!sdk4102 From: sdk4102@ritvax.isc.rit.edu (KNIGHT, SD) Newsgroups: comp.sys.mac.programmer Subject: Re: writing a text file Message-ID: <1991Apr24.222803.6528@isc.rit.edu> Date: 24 Apr 91 23:23:08 GMT References: <1991Apr24.074449.1148@uokmax.ecn.uoknor.edu> Sender: news@isc.rit.edu (USENET News System) Reply-To: sdk4102@ritvax.isc.rit.edu Organization: Rochester Institute of Technology Lines: 38 News-Software: VAX/VMS VNEWS 1.3-4 Nntp-Posting-Host: vaxc 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? > >Thanks for your continued help. Well, while Ptr's have been known to nibble on me, they rarely bite (but when they do!!!). Any pointer will do (Ptr = pointer). Some examples: int ptr1[10], *ptr2; long len; Str255 str; /* some code */ len = sizeof(int) * 10; FSWrite (refNum, &len, ptr1); /* or */ ptr2 = ptr1; len = sizeof(int) * 10; FSWrite (refNum, &len, ptr2); /* or in your case */ strcpy (str, "a line of text\ranother line of text"); len = strlen(str); FSWrite (refNum, &len, str+1); Please, cash only, and in small denominations. > >-- >----------------------- >Kent Miller >KENT@aardvark.ucs.uoknor.edu >Bitnet -> KENT@uokucsvx steve knight