dcc@ncsuvx.ncsu.edu (Daniel Carr) (05/10/89)
i'm using lightspeed pascal 2.0 and i'm writing a text filter as an 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 (filtering some characters if necessary). Then i use TESetText to plug the second one back into the TextEdit record. But what do i do with the first one? i don't need it anymore, so i want to dispose of it, but if i do, the handle in the TextEdit record (hText) gets nullified. thanks for any help, daniel "I steal from the rich and give to the poor, namely me." -Robin Hoodlum >>>>>>>>>>>>>>>>>>>>>>>> Daniel C. Carr <<<<<<<<<<<<<<<<<<<<<<<< >>>>>>> North Carolina State University Computing Center <<<<<<< dcc@ncsuvx.ncsu.edu netoprdc@ncsuvm.BITNET d.c.carr, GEnie
siegel@endor.harvard.edu (Rich Siegel) (05/10/89)
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 ~~~~~~~~~~~~~~~