Sign in to follow this  
Followers 0
apsync

or

4 posts in this topic

how do i 'or' for example ->

If $A = 5 Or $B = 7 Then
 ;...
EndIf

is that valid?

Share this post


Link to post
Share on other sites



how do i 'or' for example ->

If $A = 5 Or $B = 7 Then
;...
EndIf

is that valid?

<{POST_SNAPBACK}>

When you read the language reference doc under operator you found out the operator precedence definition and you found out the = will take place before OR so your code is equivalent to

If ($A = 5) Or ($B = 7) Then
;...
EndIf

I hope it is what you want

PLease look at the doc and report what can be missing or wrong :(

Share this post


Link to post
Share on other sites

Anyway you should always use parentheses in compound boolean expressions.

- saves having to remember operator precedence (especially useful if you work in more than one programming language).

- makes your code easier to maintain & less ambiguous for others to read.

If ($A = 5) Or ($B = 7) Then
If $A = (5 Or ($B = 7)) Then

Ignorance is strength.

Share this post


Link to post
Share on other sites

oh ok thank you botth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0