Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Afternoon all

 

 

I need to display my set value always as 5 figures, ie 200ft would show 00200

 

i tried the below, no joy

    Dim fsAPAltitudeValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07D4)
    Dim APAltitudeValue

            Me.APAltitudeValue = fsAPAltitudeValue.Value * 3.28084 / 65536
            Me.APAltitudeValue = Math.Round(APAltitudeValue, 0)
            TextBox1.Text = Me.APAltitudeValue.ToString("00000")

 

Similar thing with the VS, negative VS gives a value or 65,000

    Dim fsAPVSValue As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H07F2)
    Dim APVSValueMe.APVSValue = fsAPVSValue.Value
Posted

Hi,

 

The Altitude problem is because the variable Me.APAltitudeValue has not been given a type when you defined it. If you say it's a decimal it will work:

Dim APAltitudeValue As Decimal

The VS Hold problem is because you've declare the offset as 4 bytes (Integer) when it's only 2. It will work if you change the declaration to be Short (2 bytes):

    Dim fsAPVSValue As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H07F2)

Paul

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.