what i ended up doing is creating a function:

Word DoAlert(CharPtr pszFormat, ...);

(yes, that's literally "...", for vargs).  the DoAlert function calls
StrVPrintF to build a string, and then calls FrmCustomAlert using an alert
template whose message is simply "^1".  that way i completely sidestep the
problem, and it has the nice side effect of being more convenient to begin
with.  the only drawback is localization when i need to change the order of
the parameters instead of just changing the alert message from "^1 foo ^2"
into "^2 ^1 bar" or something.  but i have a different solution for that,
which is to write my own Format function instead of using StrVPrintF, so
that the formatting string can explicitly index the parameters.  for
instance "<1s> foo <2s>" turns into "<2s> <1s> bar".


----- Original Message -----
From: Stuart Norton <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 14, 1999 11:15 AM
Subject: RE: MemoryMgrNew Crash


> Ok. You all win. I'll do it. non-zero length it is!
>
> Stuart Norton
>
> -----Original Message-----
> From: Jason Dawes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 14, 1999 6:59 PM
> To: [EMAIL PROTECTED]
> Subject: RE: MemoryMgrNew Crash
>
>
> At 01:32 PM 7/14/99 +0100, you wrote:
> >Ok. I'll use a handle. Here's the whole function anyway (for the whole
Palm
> >Developer Community to laugh at!...Remember I'm still learning)
> >
> > FrmCustomAlert(CustomAlert,"","Writing Field...","");
> > FrmCustomAlert(CustomAlert,"",newtext,"");
>
> These calls ring a bell - there has been some discussion recently about
> using zero length strings in FrmCustomAlert & it's behaviour when you do
> this.  Apparently it is not a good idea to do this to replace a
> place-holder with nothing.  You should either (depending on who you listen
> to) use a non-zero length blank string:
>
> FrmCustomAlert(CustomAlert, " ", "Writing Field...", " ");
>
> or, use a NULL:
>
> FrmCustomAlert(CustomAlert, NULL, "Writing Field...", NULL);
>
>
>
>
>

Reply via email to