Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: TEGetText and TESetText Keywords: THINK,pascal,TE,Text Message-ID: <1789@husc6.harvard.edu> Date: 10 May 89 11:23:14 GMT References: <2963@ncsuvx.ncsu.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Distribution: na Organization: Symantec/THINK Technologies, Bedford, MA Lines: 32 In article <2963@ncsuvx.ncsu.edu> dcc@ncsuvx.ncsu.edu (Daniel Carr) writes: >extension to Stephen Chernicoff's MiniEdit program. I use TEGetText to get >a handle to the actual text (a packed array of characters) and then i create >a new handle. I read a character from the first and put it in the second You could: - not copy the text handle at all, and simply munge hTE^^.hText, and call TECalText() when you're done. - copy hTE^^.hText using HandAndHand, munge the copy, then use DisposHandle() to clear the old hTE^^.hText, assign your copy to hTE^^.hText, and call TECalText(). TESetText copies the source, so once it's done, you could simply dispose your copy of the text, since it's not needed any more. The catch is that it's very memory-inefficient, since right after TESetText, there are THREE copies of your text in RAM. Using (1) above, there's only one copy. --Rich ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "She told me to make myself comfortable, so I pulled down my pants and sat in the pudding." -Emo Phillips ~~~~~~~~~~~~~~~