Does your line look like this:
while( nIndex < nAmount )
or like this:
while( nIndex < nAmount );
A common mistake is to add the semi-colon.
Or what is the data type of nAmount? If it's a char, then the compiler might be
treating it as signed, in which case it's not big enough to hold 128.
-- Keith
"Evgeny Rokhlin" <[EMAIL PROTECTED]> on 03/31/2000 01:16:13 AM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: "Evgeny Rokhlin" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Keith Rollin/HQ/3Com)
Subject: Error using "while" in CW6
I can't believe my eyes!
My program (executed on Palm) gave me results, that were different from the
results of the same program, executed on PC.
I used debugger and found out, that in this piece of code:
while( nIndex < nAmount )
{
.......calculations;
nIndex++;
}
pKey->m_lLastRead += nIndex-1;
Having nIndex=0 and nAmount=128 the compiler ignored
{ .......calculations;
nIndex++;
}
and went straight to the line pKey->m_lLastRead += nIndex-1; !!!
Well, can't I use while() in CW?
--
Best regards
Evgene Rokhlin,
Software Engineer.
mailto:[EMAIL PROTECTED]
http://www.ectaco.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html