Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!labrea!jade!ucbvax!ANDREW.CMU.EDU!rs4u+ From: rs4u+@ANDREW.CMU.EDU (Richard Siegel) Newsgroups: comp.sys.mac Subject: RE: LSC printf() and String resource problem Message-ID: Date: Thu, 10-Sep-87 12:35:21 EDT Article-I.D.: andrew.YVFhH9y00W0YyhY0HC Posted: Thu Sep 10 12:35:21 1987 Date-Received: Sat, 12-Sep-87 09:23:07 EDT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 36 I haven't tried the code yet (I will, though) but what immediately strikes me is that you don't lock the STR resource before you call printf(). Since printf() calls an assortment of routines that are in the class of "routines that may move or purge memory", it's likely that your string is moving away on you. Try this bit of code and see what happens: #include #include #include #include #define StringID 30292 main() /* This code works as written. */ { char **myText; myText = (char **)GetString(StringID); HLock((Handle)(myText)); PtoCstr(*myText); /* sorry about that indent ^^ */ printf("%s\n", *myText); ExitToShell(); } As I said, I'll try the code and if I come across anything else I'll post. --Rich ****NOTE: The opinions (if any) herein are my own opinions and are in no way representative of my employer's policies. Richard M. Siegel Customer Support Representative THINK Technologies, Inc.