>If you're getting a lot of strings, then option 3 is to write two
>utility routines, in which case it takes 16 bytes of code per string
>usage.
>
> const Char* someString = GetAndLockStringResource(1000);
> <use the string>
> ReleaseLockedStringResource(someStringP);
Actually all you need is ONE routine, like this:
StrCopyFromResource(myString,1000)
which gets the string, copies it into your own string variable (which can
be located anyplace), and then releases the resource. Obviously this
means that "myString" always has to be larger than the largest possible
string being read from a resource, but that's usually no problem to
arrange. Doing this with one routine instead of two makes the code for
the rest of the app that much cleaner.
Steve Patt
President, Stevens Creek Software
http://www.stevenscreek.com/palm
Best PQA ("ePQA"), PalmSource 99
Best Application ("PizzaScan"), Palm Developer's Conference 1998
First printing software for the Palm - September, 1997
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/