In the second use of StrPrintF your format string is telling the
StrPrintF function to expect 4 byte values on the stack, but you are
still just pushing 2 byte values onto the stack.  If you cast the two
literals to 'unsigned long' (or the appropriate Palm data type) your
second case will give the results you expect.

I'm not sure what is up with your third example, but I suspect that it
is a similar problem (mismatch between the argument sizes expected and
the actual arguments passed).

Good luck,
-jjf

-----Original Message-----
From: Fredrik Jagenheim [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 04, 2000 5:36 AM
To: Palm Developer Forum
Subject: StrPrintF bug?


Have I misunderstood something, or stumbled over a bug?

   StrPrintF(charP, "%u %u", 4, -4);
gives:
       charP = 0x1a614 "4 65532"

Which is correct, as I understand things; But:

   StrPrintF(charP, "%lu %lu", 4, -4);
Ought to return the same thing:
      charP = 0x1a614 "327676 3855"

And:

   StrPrintF(charP, "%lu %lu", uniqueId, temp);
with (uniqueId is TimGetSeconds()):
   print uniqueId
      $1 = 3040295183
   ptype uniqueId
      type = unsigned long
   charP = 0x1a614 "-1254672113 3855"

I sort of need TimGetSeconds in a textstring, so if anyone know of a
fix / getaround or if I'm just doing something really stupid, let me
know. :)

Thanks,
//Fredde

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

-- 
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