Jump to content

Recommended Posts

Posted (edited)

Good morning

Google translation

NAV & LOGO Airbus a320 Fenix

Is it possible to create a script that would do this:

If today's date is odd then set the NAV & LOGO switch to 1 If today's date is even then set the NAV & LOGO switch to 2

I know that it's useless, in simulation it's just out of curiosity

THANKS

Edited by ptimale
  • Commercial Member
Posted

(E:LOCAL·DAY·OF·MONTH,·Number)·2·%·0·==·if{·1·}·els{·2·}·(>L:S_OH_EXT_LT_NAV_LOGO,·Number)
 

LORBY-SI

Posted

Good morning


it works very well thank you


I was looking in the docs if a function existed, but it was in simvar\environment variables


could you explain your script to me?
THANKS

  • Commercial Member
Posted (edited)
36 minutes ago, ptimale said:

could you explain your script to me?

"If the day of the current date modulo 2 equals 0 then set the appropriate Fenix LVar to 1, if not, set it to 2."

What is it specifically that you don't understand?

Edited by Lorby_SI

LORBY-SI

Posted

In your RPN expression, you divide the local day of the month by 2 (E:LOCAL · DAY · OF · MONTH, · Number 2%). If the result of this division is zero, it means that the day of the month is even, because an even number divided by 2 leaves no remainder. Otherwise, if there is a remainder, the day is odd. So in your expression, if the day of the local month is even, it will return 1 (with "si{ 1 }"), otherwise, it will return 2 (with "els{ 2 }"). This allows you to determine whether the day is even or odd based on the return value of this expression.

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
  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...