Sub TestFloatingPoint
Dim strSQL As String
Dim Cursor1 As Cursor
Dim GeoPoint1 As OSMDroid_GeoPoint
Dim dLatitude As Double
Dim dLongitude As Double
strSQL = "CREATE TABLE IF NOT EXISTS TEST_FLOAT([ID] INTEGER, [LATITUDE] REAL, [LONGITUDE] REAL)"
General.SQL1.ExecNonQuery(strSQL)
strSQL = "DELETE FROM TEST_FLOAT"
General.SQL1.ExecNonQuery(strSQL)
strSQL = "INSERT INTO TEST_FLOAT(ID, LATITUDE, LONGITUDE) VALUES(1, 52.594629, -2.1790476)"
General.SQL1.ExecNonQuery(strSQL)
strSQL = "SELECT LATITUDE, LONGITUDE FROM TEST_FLOAT"
Cursor1 = General.SQL1.ExecQuery(strSQL)
Cursor1.Position = 0
GeoPoint1.Initialize(Cursor1.GetDouble2(0), Cursor1.GetDouble2(1))
dLatitude = Cursor1.GetDouble2(0)
dLongitude = Cursor1.GetDouble2(1)
strSQL = "SELECT ID FROM TEST_FLOAT WHERE LATITUDE = ? AND LONGITUDE = ?"
Cursor1 = General.SQL1.ExecQuery2(strSQL, Array As String(GeoPoint1.Latitude, GeoPoint1.Longitude))
Cursor1.Position = 0
General.RunLog("TestFloatingPoint, GeoPoint1.Latitude: " & GeoPoint1.Latitude & ", GeoPoint1.Longitude: " & GeoPoint1.Longitude)
General.RunLog("TestFloatingPoint, Cursor1.RowCount: " & Cursor1.RowCount)
Cursor1 = General.SQL1.ExecQuery2(strSQL, Array As String(dLatitude, dLongitude))
Cursor1.Position = 0
General.RunLog("TestFloatingPoint, dLatitude: " & dLatitude & ", dLongitude: " & dLongitude)
General.RunLog("TestFloatingPoint, Cursor1.RowCount: " & Cursor1.RowCount)
Cursor1.Close
End Sub