; Print #1, val
End If
last_lat = lat_deg
last_lon = lon_deg
End If
End If
End If
End Function
Function nmeadegrees2decimal(degrees_nmea As Double, direction As String) As Double
'''' convert from ddmm.mmmm to decimal
Dim val As Double
If direction = "N" Or direction = "S" Then
dd = Mid(degrees_nmea, 1, 2)
mm_mmmm = Mid(degrees_nmea, 3)
Else
If degrees_nmea < 10000 Then
dd = Mid(degrees_nmea, 1, 2)
mm_mmmm = Mid(degrees_nmea, 3)
Else
dd = Mid(degrees_nmea, 1, 3)
mm_mmmm = Mid(degrees_nmea, 4)
End If
End If
val = dd + mm_mmmm / 60
If direction = "S" Or direction = "W" Then
val = val * -1
End If
nmeadegrees2decimal = val
End Function
Function GetToken(ByVal strVal As String, intIndex As Integer, strDelimiter As String) As String
''''-------------------------------------------------------
'''' Author : Troy DeMonbreun (vb@8x.com)
'''' source : http://www.freevbcode.com/ShowCode.
asp?ID=161
'''' Revised : 12/22/1998
''''-------------------------------------------------------
Dim strSubString() As String
Dim intIndex2 As Integer
Dim i As Integer
Dim intDelimitLen As Integer
intIndex2 = 1
i = 0
intDelimitLen = Len(strDelimiter)
Do While intIndex2 > 0
ReDim Preserve strSubString(i + 1)
intIndex2 = InStr(1, strVal, strDelimiter)
If intIndex2 > 0 Then
strSubString(i) = Mid(strVal, 1, (intIndex2 - 1))
strVal = Mid(strVal, (intIndex2 + intDelimitLen), Len(strVal))
Else
strSubString(i) = strVal
End If
i = i + 1