Reverse Polish Notation: Difference between revisions
From FSDeveloper Wiki
Jump to navigationJump to search
(Added section on relevant mission script elements) |
(Add example for if else construction) |
||
| Line 36: | Line 36: | ||
1800 (>X:VariableToChange) | 1800 (>X:VariableToChange) | ||
This example changes the variable <code>VariableToChange</code> to 1800. | This example changes the variable <code>VariableToChange</code> to 1800. | ||
=== If, Else construction === | |||
(condition) if{this} els{that} | |||
If the condition is true, the condition will be <code>{this}</code>, otherwise it will be <code>{that}</code>. | |||
Revision as of 17:33, 11 December 2021
| Applicable |
|---|
| MSFS |
| MS Flight |
| LM P3D5 |
| LM P3D4 |
| LM P3D3 |
| LM P3D2 |
| LM P3D |
| FS World |
| FSXSE |
| FSXA |
| FSX |
| FS2004 |
| FS2002 |
| XP11 |
| XP10 |
| XP9 |
Reverse Polish Notation, or RPN, is a way to write down formulas. It is used in MSFS for gauges, model behaviors, and in mission scripts for PropertyTriggers, ProximityTriggers, and Calculators.
The documentation on RPN thoroughly explains how it works.
Mission Script Elements that use RPN
| Calculator |
| PropertyTrigger |
| ExecuteRPNAction |
Examples
Changing a variable
You can change a variable with RPN code in a Calculator or Execute RPN Action.
1800 (>X:VariableToChange)
This example changes the variable VariableToChange to 1800.
If, Else construction
(condition) if{this} els{that}
If the condition is true, the condition will be {this}, otherwise it will be {that}.