High-Octane Posted March 24, 2004 Report Posted March 24, 2004 I m trying to figure out the proper way to write codes to have the values displaying in text with values of 1 and 0 -- IE Warning indicator, on and off indicator. Now let start with master Switch-- The codes I wrote Dim Master as Boolean Call FSUIPC_Read(&H2E80, 4, VarPtr(Master), dwResult) Call FSUIPC_Process(dwResult) If Master = True Then MasterLightOn.Caption = Format(Master, "Master ON") Else Master = False End If When I complie it, it shows no error... When running with FS2002.. The display text on my application dont seem to show anything when switching on/off on a cessna panel from FS2002... Would anyone know what went wrong? did I implement the code correctly? and what are your suggestion? Thanks in Advance P.S. I m kinda of doing this in haste... This project that I am working on is in regard for my final exam at college. (Due in 3 weeks from now)
Pete Dowson Posted March 25, 2004 Report Posted March 25, 2004 If Master = True ThenMasterLightOn.Caption = Format(Master, "Master ON") Else Master = False End If I don't know VB, but it looks like you are setting the variable Master to FALSE when it is FALSE. Why? Where do you change the Caption to "OFF"? Regards, Pete
High-Octane Posted March 25, 2004 Author Report Posted March 25, 2004 Yup that's the point... this is where I am confused and need some help...
rickalty Posted March 25, 2004 Report Posted March 25, 2004 Arthur: Dim Master as Boolean Call FSUIPC_Read(&H2E80, 4, VarPtr(Master), dwResult) Call FSUIPC_Process(dwResult) If Master = True Then MasterLightOn.Caption = Format(Master, "Master ON") Else Master = False End If Try this... Dim Master as Boolean Call FSUIPC_Read(&H2E80, 4, VarPtr(Master), dwResult) Call FSUIPC_Process(dwResult) If Master = True Then MasterLightOn.Caption = "Master ON" Else MasterLightOn.Caption = "Master OFF" End If In the 'Else' condition, instead of setting MasterLightOn.Caption to "Master OFF" if Master was False, you were just setting Master to False if it was already false - ie doing nothing. Richard
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