IonicWind Software

IWBasic => General Questions => Topic started by: Copex on November 26, 2006, 07:53:17 PM

Title: syntax strange result
Post by: Copex on November 26, 2006, 07:53:17 PM
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 :-)
Title: Re: syntax strange result
Post by: Ionic Wind Support Team on November 26, 2006, 07:58:38 PM
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.
Title: Re: syntax strange result
Post by: Copex on November 27, 2006, 03:28:00 PM
 ;) i see....