XML: Macros - Set Xpndr Code: Difference between revisions
From FSDeveloper Wiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Infobox-Applicable-FSVersion | {{Infobox-Applicable-FSVersion | ||
| P3D2 = true | |||
| P3D = true | |||
| FSXI = false | | FSXI = false | ||
| FSXA = true | | FSXA = true | ||
| Line 7: | Line 9: | ||
| FS2000 = false | | FS2000 = false | ||
| FS98 = false | | FS98 = false | ||
| XP10 = unknown | |||
| XP9 = unknown | |||
}} | }} | ||
| Line 25: | Line 29: | ||
''' | '''An alternative is to let FS handle the Units conversion''' | ||
1234 (>L:XPDR_Code, enum) | 1234 (>L:XPDR_Code, enum) | ||
Latest revision as of 04:34, 22 August 2014
== Transponder Set Macro ==
<Macro id="XPDR Set" Name="XPDRSet">
<MacroValue>
@1 s0 10 % l0 10 /
int 10 % 16 * + l0 100 /
int 10 % 256 * + l0 1000 /
int 4096 * + (>K:XPNDR_SET)
</MacroValue>
</Macro>
@XPDRSet(1200)
@XPDRSet((L:XPDR_Code,number))
An alternative is to let FS handle the Units conversion
1234 (>L:XPDR_Code, enum) (L:XPDR_Code, Bco16) (>K:XPNDR_SET)
In this example, the transponder code will be set to the number 1234. Flight Simulator internally handles the number conversion from decimal to Bco16 units.