Sign in to follow this  
n4gix

Anyone know why this isn't working?

Recommended Posts

If the value of COM_mem[12] is 0.00, then I want to suppress display, otherwise, display the value: if (COM_mem[12] != 0.00f) { swprintf(buf,L"%3.2f",COM_mem[12]); } else { swprintf(buf,L""); }Unfortunately, it isn't working as expected... swprintf(buf,L"");by itself works as expected, so obviously the problem is in the if condition... I've tried using simply 0, 0.00, and now 0.00f and none of 'em work.

Share this post


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

Just for the record, the syntax for the evaluation is quite correct and works perfectly...The problem turned out to be that the contents of the array weren't actually zero...Lesson learned: don't try to use an integer variable to initialize a float variable... ;)Another lesson learned: don't try to run a loop in PRE_UPDATE or PRE_DRAW, unless you provide a flag to inhibit it from running twice... since both PRE_UPDATE and PRE_DRAW are run twice per gauge cycle...

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