At 06:36 AM 8/20/2003, Eitan wrote:
I try to use a simple string format, but the result
seems wrong,
I try it using CString, after this failed I try using
StrPrintF
Here is a demo code:

CString myStr;
myStr.Format("%d  Test?  %d  last!  %d" ,3,5,7);
FrmCustomAlert(GeneralAlert, myStr, "", "");

char msg[100];
StrPrintF (msg,"%d  Test?  %d  last!  %d" ,3,5,7) ;
FrmCustomAlert(GeneralAlert, msg, "", "");

In both, the result where:
"0  Test?  3  last! 0"  (it should be "3  Test?  5
last! 7")
This code runs on Palm OS simulator, (5.0 and 5.2)

It looks like you've got the 4-byte ints option turned on for your project. You shouldn't use this unless you have a really good reason, as it affects varargs functions like StrPrintF. If you want to use this, you need to change your "%d" to "%ld" to tell it that the numbers are 4-bytes long.


--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com



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

Reply via email to