Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!ames!ncar!husc6!unix!stores From: stores@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Macintosh handles Keywords: handle, TextEdit, FSWrite Message-ID: <1409@unix.SRI.COM> Date: 19 Jul 89 16:10:24 GMT References: <1044@clinet.FI> <8043@hoptoad.uucp> Reply-To: stores@unix.UUCP (Matt Mora) Distribution: comp.sys.mac.programmer Organization: SRI International, Menlo Park, CA Lines: 31 In article <8043@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >In article <1044@clinet.FI> maa@clinet.FI (Miika Asunta) writes: > >>2) How can I store a TEstylehandle entirely into a file? Is >> the following (written in pseudo-code) enough: >> FSWrite n bytes , pointer (TEstylehandle^) > ^^^^^ Tim, think he wants to save the style information not just the text. >That's just about correct, yes. In C, actual code would be: >FSWrite(refnum, (long)(*te)->teLength, *((*te)->hText)); >and if my Pascal hasn't gotten too rusty, that would be: >FSWrite(refnum, te^^.teLength, (te^^.hText)^); > I haven't used the new TE styles yet butI read the chapter awhile ago and i think it mentions somthing about a new scrap type 'styl' that you might be able to save in the resource fork. Haven't tried it just guessing. -- ___________________________________________________________ Matthew Mora SRI International stores@unix.sri.com ___________________________________________________________