Jump to content
Sign in to follow this  
ChrisK

Reading a P variable in C/C++ code

Recommended Posts

Do you know if reading a P variable from a C/C++ code can be done? If yes, how?For example, if I want to read the TIME ZONE OFFSET variable, I can do it in XML:(P:TIME ZONE OFFSET, minute)But can I do the same from C/C++ ?Thanks !!Eric

Share this post


Link to post
Share on other sites

Eric,This from GAUGES.H BOOL (FSAPI *execute_calculator_code) (PCSTRINGZ code, FLOAT64* fvalue, SINT32* ivalue, PCSTRINGZ* svalue);You can use it to evaluate pretty much any XML expression. I have used it to return a floating point A: or L: variable. No reason why it shouldn't give you one of the P: values.Doug

Share this post


Link to post
Share on other sites

I didn't have time to test, but if I understand this correctly, it means the "code" string should contain "(P:TIME ZONE OFFSET, minute)" and the value should be returned in the fvalue or ivalue.Is that right?Thanks for the info !!Eric

Share this post


Link to post
Share on other sites

FLOAT64 time_zone_offset;execute_calculator_code("(P:TIME ZONE OFFSET, minute)",&time_zone_offset,NULL,NULL);This should work fine.Chris


Chris Koegler

Share this post


Link to post
Share on other sites

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...