Sign in to follow this  
n4gix

Using XML variables in C... (moved from original thread)

Recommended Posts

>>Oops... more catching up to do, Dai... ;) FS9 does offer>ADF2>>now...>>...kinda, sorta...>>I'm likely to be sticking with C unless pushed. Actually, now>I come to think of it, my dayjob with The Other Big IDE>Company will probably let me learn XML anyway.Dai, I was referring to reading XML variables in a C gauge. For example, the following placed in _PRE_UPDATE:execute_calculator_code("(A:ADF ACTIVE FREQUENCY:1, KHz)",&adf1_freq,NULL,NULL);execute_calculator_code("(A:ADF ACTIVE FREQUENCY:2, KHz)",&adf2_freq,NULL,NULL);We now have adf1_freq and adf2_freq as FLOAT64 variables, with no muss, no fuss since we asked for 'em to be returned in KHz already.The function in gauges.h uses this prototype:BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);This allows us to retrieve float, integer or string values from XML variables directly. This is important since there are some variables that are only availble as XML vars, there being no C equivalent! ;)

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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
Sign in to follow this