FrmCustomAlert(myAlert, ""+CurChar, NULL, NULL); will either print
nothing or garbage I'd imagine. Are you trying to print the value of
CurChar? If so you'll need to convert it to a string first what you are
currently doing amounts to 'pointer arithmetic' and I'm not sure what
address you'll end up with!...alternately just print the value of
TempCode for debugging:
FrmCustomAlert(myAlert, TempCode, NULL, NULL);
Have you tried stepping through your code in the debugger? I'm sure
you'll find the value of CurChar will change (well, assuming any of your
if statements become true).
Stuart Nicholson
Programmer
Firepad, Inc.
-----Original Message-----
From: Patrick Ouellet [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 12, 2000 6:14 PM
To: Palm Developer Forum
Subject: Re: Newbie to Palm question about using variable
The problem here is that it doesn't change even the first time.
I can't change the content of TempCode, in any way.
Say I put 1234 as the definition value of TempCode
char TempCode[5] = "1234";
I can never change that value....
It this and what ever I do It doesn't change.
More... the CurChar variable
if I print it with an alert
FrmCustomAlert(myAlert, ""+CurChar, NULL, NULL);
it print "" nothing...
---------
Ok, say I want to have a string with 1234 in it
and replace it's content with the caption of the button I press
how would you do that...( without having to extract the caption from the
button,
I already know, what's on the button)
Stuart Nicholson wrote:
> I think you'll find the last if statement is changing the address of
the
> TempCode string (strings are just addresses in C) to point to the
static
> "0000\0" string you define. Once you've done this the first time I
think
> you'll find you can't change the string contents any more (actually
I'm
> surprised the Palm Emulator doesn't complain when you try to).
>
> I'd say instead of this:
>
> if( // the '#' button is pressed )
> {
> *TempCode = "0000\0";
> CurChar = 0;
> }
>
> You should do something like this:
>
> if( // the '#' button is pressed )
> {
> StrCopy( TempCode, "0000\0" );
> CurChar = 0;
> }
>
> But then I could be wrong ;) hope that helps!
>
> Stuart Nicholson
> Programmer
> Firepad, Inc.
>
--
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/