April 16, 2024, 04:13:46 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


syntax strange result

Started by Copex, November 26, 2006, 07:53:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Copex

Hi

Ok this is probley not a BUG just bad synax , but it gives a strange result, well not what i exspected :-)

the correct syntax i think is....

if (condition = first test) or (condition = second test)
ÂÃ,  ÂÃ,  ÂÃ,  do something intresting :-)
endif

now this works fine but if you write the code as below

if condition = first test or second test
ÂÃ,  ÂÃ,  ÂÃ,  do something intresting :-)
endif

you dont get any errors & the if stament is processed as the stament is TRUE :-) even if the condition iÂÃ,  <>

maybe its just me :-)
-
I really should learn how to use a spell checker! though im not sure how it will help someone who can not spell?
-
Except where otherwise noted, content Posted By Copex is
licensed under a Creative Commons Attribution 3.0 License

http://creativecommons.org/licenses/by/3.0/

Ionic Wind Support Team

The second test isn't a condtition, in your second example, will be treated as a boolean. 0 = false, <>0 = true.

Think of it in terms of numbers.

if (1 = 2) OR (2=2)
endif

if 1 = 2 OR 2
endif

the OR 2 always resolves to TRUE since it is not FALSE.

Paul.
Ionic Wind Support Team

Copex

-
I really should learn how to use a spell checker! though im not sure how it will help someone who can not spell?
-
Except where otherwise noted, content Posted By Copex is
licensed under a Creative Commons Attribution 3.0 License

http://creativecommons.org/licenses/by/3.0/