Jump to content

Recommended Posts

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 :(

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...