Sign in to follow this  
Guest Patrick_Waugh

Any idea why this doesn't work?

Recommended Posts

I tested this code outside of the sim, and it worked... but interestingly... when I trigger it in the sim, the 1st character (code[0]) never shows up.So, if I enter "2345" in the scratchpad, then hit the key to trigger this method, I get "345" in the Xpdr.void Xpdr::SetXpdr1Code(){ UINT32 bcd = 0; // encoded xpdr code (ie 1200 coded to 4608) const wchar_t *code = ScratchPad::GetText().c_str(); bcd = (code[0] - 0x30) << 12; bcd += (code[1] - 0x30) << 8; bcd += (code[2] - 0x30) << 4; bcd += (code[3] - 0x30); trigger_key_event(KEY_XPNDR_SET, bcd);}If I set a break point, I do see the full text "2345" is in the scratchpad, but strangely I can't see any of the local variables in the debugger.More strangely, the code works fine in a console app with the *code = "2345".Anyone see why this happens??

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