Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!kth!draken!tut!santra!clinet!maa From: maa@clinet.FI (Miika Asunta) Newsgroups: comp.sys.mac.programmer Subject: Macintosh handles Summary: Some Questions of handles Keywords: handle, TextEdit, FSWrite Message-ID: <1044@clinet.FI> Date: 17 Jul 89 20:28:18 GMT Followup-To: comp.sys.mac.programmer Distribution: comp.sys.mac.programmer Organization: City Lines Oy, Helsinki, Finland Lines: 27 Sender: I have some questions considering use of handles with Mac Applications. 1) What is the best way to allocate a chain without fragmenting the memory? Using handles is not as simple as you might think at first - You need to allocate master pointers with MOREMASTERS for all your handles in the main datasegment (#1), and you won't know the amount of handles in a chain forehand. I know that when all of them are in use system calls moremasters again to allocate more pointers, but it can fragment memory! 2) How can I store a TEstylehandle entirely into a file? Is the following (written in pseudo-code) enough: ... ... FSWrite n bytes , pointer (TEstylehandle^) ... ... Quite rough code, but - I hope - understandable! The idea is that I can edit several pieces of text having only one TEHandle allocated! Are there any technical notes considering the questions? -- ************************************************************************* * Miika Asunta * Double Basist * * internet: maa@clinet.fi * Macintosh Programmer * * UUCP: mcvax!santra!clinet!maa * *