hawkt1 Posted December 19, 2015 Report Share Posted December 19, 2015 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 Link to comment Share on other sites More sharing options...
Paul Henty Posted December 20, 2015 Report Share Posted December 20, 2015 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 Link to comment Share on other sites More sharing options...
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