Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

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.

Use of "OR" operator...

Featured Replies

Hey there,

I am still working on my own stream deck profile for the fenix A320 series. So its seams that in the stream deck plugin I cannot seem to "OR" three values.

My "code" as of right now:

(L:I_MIP_AUTOBRAKE_MAX_L, number) 1 == (L:I_MIP_AUTOBRAKE_MED_L, number) 1 == (L:I_MIP_AUTOBRAKE_LO_L, number) 1 == ||

As it stands it returns true if either "..._MAX_..." or "..._LO_..." are 1. Shouldn't that in theory return true if either of those three values are 1?

Any help would be much appreciated,

Thank you,

Danno

Edited by danno1502

ngxu_banner.png

  • Commercial Member

Just like in normal infix code, the OR is a binary operator, it processes two operands only. You need another OR in your code. 

OR  the first two variables, then OR the result with the third.

Edit, btw, when those variables have only 0/1 as values, you can remove the 1 == parts. (the result of which would also be 0/1)

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) || (L:I_MIP_AUTOBRAKE_LO_L, number) ||

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

Or use maths. Add up all three variables, and if the result is not 0 the at least one of them was set.

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) + (L:I_MIP_AUTOBRAKE_LO_L, number) + 0 !=

Edited by Lorby_SI

LORBY-SI

  • Author
12 hours ago, Lorby_SI said:

Just like in normal infix code, the OR is a binary operator, it processes two operands only. You need another OR in your code. 

OR  the first two variables, then OR the result with the third.

Edit, btw, when those variables have only 0/1 as values, you can remove the 1 == parts. (the result of which would also be 0/1)

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) ||(L:I_MIP_AUTOBRAKE_LO_L, number) ||

Oh, I tried this, but didnt get it to work. I believe because I left a space behind the first ||...

ngxu_banner.png

  • Author
11 hours ago, Lorby_SI said:

Or use maths. Add up all three variables, and if the result is not 0 the at least one of them was set.

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) +(L:I_MIP_AUTOBRAKE_LO_L, number) + 0 !=

Oh dear, this is so simple.. I was so in tunnel vision in regards to the OR operator...

Thank you so much for your swift reply!

ngxu_banner.png

  • Author

I am afraid I have to get back to this as I cant seem to get it to work, even with your code.

With your code for MED and LO it works; for MAX not.

ngxu_banner.png

  • Commercial Member

All the scripts had typos in them. There must be a space between everything, in this case between || or + and the following bracket. I've corrected and tested them both (for a change)

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) || (L:I_MIP_AUTOBRAKE_LO_L, number) ||

(L:I_MIP_AUTOBRAKE_MAX_L, number) (L:I_MIP_AUTOBRAKE_MED_L, number) + (L:I_MIP_AUTOBRAKE_LO_L, number) + 0 !=

 

Edited by Lorby_SI

LORBY-SI

  • Author

Worked like a charm. Thank you! 🙂

ngxu_banner.png

Create an account or sign in to comment

Account

Navigation

Search

Search

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.