ark1320 Posted Saturday at 09:04 PM Report Posted Saturday at 09:04 PM In my experience Lvar names are not case sensitive in XML coding. But when used in Lua scripts with commands such as ipc.writeLvar("L: Name", value) or ipc.readLvar("L:Name") they are case sensitive, I assume because when enclosed in quotation marks they are treated like strings. This caused me a problem lately in MS2024 because in the XML code for an aircraft, the developer accidentally (I assume) was not consistent case-wise with some of the Lvars names. As a result my Lua scrip, which used Lvar read and write commands like the above, did not work as expected. So I'm posting this in case it helps someone in the future. What I eventually noted was in the Lvar list that the FSUIPC7 wasm provides, a few of the Lvar names had a different case then in the section of XML coding I was trying to access. Perhaps the wasm Lvar list "uses" whatever case the first Lvar it comes across is using -- don't really know. The Lvar list did not include both case variations of the Lvar name. It would be convenient if commands like ipc.readLvar( ) were not case sensitive, but that may not be possible. In my case, I had to use ipc.execCalcCode(" ") to get around the case issue because the Lvar names are not case sensitive in the XML CalcCode. If something above is not correct, or there is a better solution to this case sensitive Lvar issue, please let me know. Thanks, Al
John Dowson Posted Sunday at 01:24 PM Report Posted Sunday at 01:24 PM The case of the lvar names used by FSUIPC is exactly that used when the lvar name is retrieved (in the WASM) by the gauge API function get_name_of_named_variable. These are then used in FSUIPC and are case sensitive. However, all functions/activity on lvars between the WASM and WAPI uses ids and not the name itself. So I could easily make access to lvar names case insensitive in the WAPI (and thus in FSUIPC) by making the WAPI lvar-name-to-id function (getLvarIdFromName) case insensitive. I can update this in the next WAPI update, but I am not sure when this will be at the moment, but there will certainly be one sometime this year. Note that if you use calculator code to access/update lvars rather than the lvar interface, then they will be case insensitive. Cheers, John
ark1320 Posted Sunday at 03:12 PM Author Report Posted Sunday at 03:12 PM Hi John, Making Lvar names in FSUIPC insensitive would certainly be helpful when you have time to do it. Thanks very much, Al
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now