Page 1 of 1

PostPosted: Mon Aug 18, 2003 7:38 pm
by Tjadmaen
Hi all. I am sorry if the question sounds dumb to you, but I still can't get into the basics of pocketc. Here's the problem...
How can I make such thing working:

//must quit if pressed 'q' for example, when prompted
char ch;
ch = getc();
if (ch = 'q')
else alert("bla bla");

but it quits always I press ANY button...
Please help! I can't overcome this simple start

PostPosted: Tue Aug 19, 2003 8:54 am
by Brendan Donovan
In your if statement, you need to use a double ='s sign.


One = sign is an assignment (hence your statement was always true)
Two == signs is a comparison

Hope this helps,

PostPosted: Tue Aug 19, 2003 7:48 pm
by Tjadmaen
yes, that's it!
Thanks, Brendan!