I’m trying to understand RPN, allowing me to better understand what’s in the Behavior window. I have the SDK Documentation next to me, but still can’t figure out a lot of things.
This is for example a part of the RPN code that I’m struggling with. Below I will try to explain what I know (no guarantee that it is correct - so correct me if I’m wrong).
(M:Event) 'WheelUp' scmi 0 == ...
This uses the “string compare ignore case” function, so it checks for my mouse-scroll-wheel going up.
Based on the examples in the SDK Documentation, I assume that the result will be 0 if both strings are equal, which means that this evaluates to TRUE if both strings are equal (0 == 0).
if { 1 if { ... } }
This is kind of weird. The first if uses the result of the previous part, which means TRUE if my WheelUp is used. That means that what is between {} is being executed. But why then using that second if-statement? Because it will always be executed?
(O:_KnobAnimVar) 10 + dnor (>O:_KnobAnimVar)
This is to animate the button. It will increase 10° per click, and if it exceeds 359, then dnor will “normalize” it back to a value between 0 and 359. This angle is stored in the _KnobAnimVar that is used to animate the button (I guess).
3 (A:AUTOPILOT ALTITUDE LOCK VAR:3, feet) (L:XMLVAR_Autopilot_Altitude_Increment) +
I know that the A-variable holds the displayed altitude value (I have read some other posts on this). I also know that the L-variable is holding the 100 or 1000 value to increment the altitude. But what is that “3” doing in front of it?
(A:AUTOPILOT ALTITUDE LOCK VAR:3, feet) (L:XMLVAR_Autopilot_Altitude_Increment) min
I understand that “min” takes the minimum of 2 values. But here I’m completely lost. Especially in combination with the previous line. What is happening here?
(>K:2:AP_ALT_VAR_SET_ENGLISH)
The result is stored in this K-variable. But why is the “2” just behind the “K:”? This is a different kind of construction as with “A:AUTOPILOT ALTITUDE LOCK VAR:3”, where an index is added at the end. Is this “2” an index, or is this doing something else?
