Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ANDs and Parenthesis'

Featured Replies

Posted

I have three (3) ANDed conditions that must be met before an action, (THEN), can occur. what is best practice in IOX. 

As I recall from past programming in IOX parenthesis' must be used for  ANDing or ORing at times. XOR and XAND. I always get this stuff mixed up these days!

So, is the following best, (pretty exclusive that the first two conditions must be met), practice...

If
        (
             'Double Garage Door-Sensor' Status is On
         And $Can_Close is 1
        )
    And $s_GarageDoorIsOPEN is 1
 
Then

   .....

or is the code snippet the next best method to ensure that all 3 conditions are in fact met.

If
        (
             'Double Garage Door-Sensor' Status is On
         And $Can_Close is 1
        And $s_GarageDoorIsOPEN is 1
        )
     
Then

....

 

Thanks!!

John

Edited by johnjces

Solved by Guy Lavoie

Go to solution
  • Solution

The second one seems to best reflect what you want to do, visually. Both are actually equivalent. 

  • Author

Thank-you sir!

On 7/1/2025 at 6:41 PM, johnjces said:

Thank-you sir!

You don't need parenthesis at all for this.

There is no functional difference between either of the two options you showed as well as no parenthesis at all.

Mostly you would use parenthesis when you have two sets of conditions not connected by the same and/or.

ie.

(1 and 2 and 3) or (4 and 5)

(1 or 2 or 3) and (4 or 5)

 

the following are all  functionally identical

(1 and 2 and 3)

(1 and 2) and 3

1 and (2 and 3)

1 and 2 and 3

(1 and 3) and 2

  • Author

@apostolakisl

Thank-you!

John

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.