I use this little routine

' Get the value of a numeric field
' The size of the field cannot pass a word
GetNumField:
tempbyte=1 ' Used for field position of GPS Data
factor = 1 ' Used to retun the factor that we multiplied the value
FOR i = 0 to MAXDATA
IF gpsdata[i] = "," THEN
tempbyte = tempbyte + 1
ENDIF

IF tempbyte = field THEN
' isolate the value here
tempword=0
tempbyte=1
WHILE i < MAXDATA
i = i + 1
IF gpsdata[i] = "," OR gpsdata[i] = "*" THEN
RETURN
ENDIF
IF gpsdata[i] = "." THEN
factor = factor * 10
ELSE
tempword = tempword * 10
tempword = tempword + (gpsdata[i] - 48)
ENDIF
WEND
RETURN
ENDIF
NEXT i
gpsvalid = 0
RETURN


You can see all of it at:

http://cvs.sourceforge.net/viewcvs.p....2&view=markup

It also does the checksums etc.

This was a way to actually not need to know the exact format of the data since it changes on different models of GPS.

I've seen many GPS reading routines in PBP and almost all of them would break if you ever used a different GPS. Also none of them ever checked the checksum.


Mike