Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: ARRGH (Strings and things) Message-ID: <8835@hoptoad.uucp> Date: 28 Oct 89 20:06:21 GMT References: <16004@netnews.upenn.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 31 In article <16004@netnews.upenn.edu> parnes@eniac.seas.upenn.edu.UUCP (Gary Parnes) writes: >How in the heck do you access data in a string handle? Gewnerally, I don't; I use string lists and GetIndString. These are generally more convenient to access and maintain. However, when I used to use string resources, I used to use BlockMove. (Gosh, before that sentence, I never realized how convenient it was to use "use"; it has so many usages!) >I tried this reasoning: a string handle is a pointer to a pointer which points >to a Str255 data location. >But when I try setting strings like this in THINK C, it pleads complete >ignorance. It says that it's an illegal operation on an array. >So what's wrong with this? >myString=**mystringhandle; You can't assign to an array in C. You can only assign to individual elements of the array. You are on the right track, but the way to do this thing is: BlockMove(*mystringhandle, myString, 256); BlockMove doesn't touch the heap so it's safe to use this dereference even when mystringhandle is unlocked or purgeable (but not purged!) -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "As I was walking among the fires of Hell, delighted with the enjoyments of Genius; which to Angels look like torment and insanity. I collected some of their Proverbs..." - Blake, "The Marriage of Heaven and Hell"