From: "Ken Krugler" <[EMAIL PROTECTED]>

> >Do you have all three parameters (^1, ^2, and ^3) in your alert?
> >When you call FrmCustomAlert, don't pass in NULL if your alert
> >uses ^1, ^2, and ^3. For each unused parameter, pass in a string
> >containing a single blank.
>
> In pre-3.1 versions of the OS, you don't way to pass NULL or ""
> for any parameter which has a corresponding template (^1, ^2, or
> ^3) sub-string in the alert text.

I don't understand what you are saying here.  I clearly state that you
should use a string containing a single blank (" ") and you should not use
NULL.  If you check the archives, you'll find an explanation of how passing
in NULL can cause FrmCustomAlert to miscalculate the length of the message
string and therefore crash.

> >StrPrintF( msg, "Thank's for registering, %s!\n\nYour code is %s",
> >name, code );
> >FrmCustomAlert( GeneralAlert, msg, NULL, NULL );
> >
> >Note that, in this case, it is safe to pass in NULL because my
> >GeneralAlert only contains ^1.
>
> This is the kind of thing that will prevent your app from being
> localizable, for two reasons.
>
> a. You've got a hard-coded string in your code.
>
> b. The localizers are unable to re-order parameters in the
> message, which is frequently necessary to get a
> grammatically correct (or at least reasonable) translation.
>

The code fragment posted above uses the hard coded string to make the
FrmCustomAlert example clear.  In actual practice, I always used a resource
for the format string.  E.g.,

SysCopyStringResource( temp, localFormatString );
StrPrintF( msg, temp, name, code );
FrmCustomAlert( GeneralAlert, msg, NULL, NULL );

To localize the message, the localFormatString resource (in this example,
"Thank's for registering, %s!\n\nYour code is %s") gets translated.
Therefore, reasons a and b above no longer apply.  I'm sorry if simplifying
the explanation caused any confusion.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to