Re: Why Does Child Window Disappear?
- Posted by cafromsw at yahoo.com Jan 23, 2003
- 445 views
Thanks, I'll keep that in mind next time I need to sprintf() Chris cafromsw at yahoo.com --- Pete Lomax <petelomax at blueyonder.co.uk> wrote: > > On Wed, 22 Jan 2003 11:58:01 -0800 (PST), > cafromsw at yahoo.com wrote: > > >I do have one question though, why is the variable > t > >in sequence brackets {} in setText when it seems to > >works fine without them? > >setText( LText2, sprintf("This is message#%d",{t}) > ) > >setText( LText2, sprintf("This is message#%d",t) ) > > Convention: while sprintf("text %d", 2) and > sprintf("text %d",{2}) > will both produce "text 2", if you code > sprintf("text %s","test") and > sprintf("text %s",{"test"}), then (as documented in > the euphoria > reference manual) the first will unexpectedly > produce "text t", > whereas the second (the more likely wanted) "text > test". > > Also, if your format string has more than one '%d' > or '%s' etc, you > need to use the {} to pass the fields as one > parameter. > > Since you often need the {}, and sometimes omitting > them gives the > wrong answer, it is easiest just to always get used > to using them. > > Like everything else, easy once you get used to it. > > Pete > > ==^^=============================================================== > This email was sent to: cafromsw at yahoo.com > > > TOPICA - Start your own email discussion group. > FREE! > > ==^^=============================================================== >