Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!helios.ee.lbl.gov!ux3.lbl.gov!beard From: beard@ux3.lbl.gov (Patrick C Beard) Newsgroups: comp.sys.mac.programmer Subject: Re: How to use ParamText's Message-ID: <2110@helios.ee.lbl.gov> Date: 15 Mar 89 01:04:16 GMT References: <8079@csli.STANFORD.EDU> Sender: usenet@helios.ee.lbl.gov Reply-To: beard@ux3.lbl.gov (Patrick C Beard) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 33 In article <8079@csli.STANFORD.EDU> wilson@csli.stanford.edu (Nathan Wilson) writes: > >I was working on being a good person and switching all the strings in >my code to calls to GetIndString when I came across the following >problem. Under some conditions I would like to title a window (not a >dialog or alert) that displays a PICT resource something like > > ID = in > >with the stuff in <> replaced with the appropriate info. Now it >occurred to me that the best way to generate this string would be to >store it as a parameterized string as per alerts, that is > >^0 ID = ^1 in ^2 > How about: Str255 title; String format; GetIndString(format, FORMAT_STRING_ID, 1); . . PtoCstr(format); sprintf(title,format, PtoCstr(resName), PtoCstr(resNumberStr),PtoCstr(resFile)); SetWTitle(window, CtoPstr(title)); +----------------------------------------------------------------+ \ Patrick Beard "Badges? \ \ Berkeley Systems, Inc. I ain't got to show you... \ \ PCBeard@lbl.gov ...NO STINKING BADGES!" \ + ---------------------------------------------------------------+