View Single Post
  #25 (permalink)  
Old 08-10-2008, 04:11 PM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,907
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by wolfgang View Post
The only thing I do not understand is that label4.Text = n displays only even numbers
You may be getting two LocationChanged events each time and are being re-entered when you update the labels. You can check with some code like this.

Code:
ReEntry = false ' in Globals
...
Sub gpsint_GPSLocationChanged
  If Not(ReEntry) Then
      ReEntry = true
      If gpsint.GPSValid = true Then
        n = n + 1
        label2.Text = gpsint.GPSUTCTime
        label6.Text = gpsint.GPSSpeed & " [knots]"
        label4.Text = n
      Else
        label2.Text = "no fix, wait"
      End If
      hw.KeepAlive
      ReEntry = false
  End IF
End Sub