Android Question SQLite Acting Strange Part 2

Terradrones

Active Member
Hi All

This is a continuation of my previous Post.

The program remembers the last Project that one worked on. When you reload the Program, it loads the design parameters of that Project.

Here is my code:

Load SQLite in Array:
[/
    If A = 8 Or A = 100 Then
        'Hor Pi File
        i = 1
        ResultSet = SQL1.ExecQuery("SELECT * FROM HorPi")
        Do While ResultSet.NextRow
            Try
                StartStake=NumberFormat2(ResultSet.GetString("StartSV"),1,3,3,False)
                WK2(1, i + 4500) = NumberFormat2(ResultSet.GetString("PiYCoord"),1,3,3,False)
                WK2(2, i + 4500) = NumberFormat2(ResultSet.GetString("PiXCoord"),1,3,3,False)
                WK2(3, i + 4500) = NumberFormat2(ResultSet.GetString("Radius"),1,3,3,False)
                WK2(4, i + 4500) = NumberFormat2(ResultSet.GetString("TransIn"),1,3,3,False)
                WK2(5, i + 4500) = NumberFormat2(ResultSet.GetString("TransOut"),1,3,3,False)
                i = i + 1
                If i > 495 Then i = 495
            Catch
                Log(LastException)
            End Try
        Loop
        NumbHor = i - 1 
        ii2 = i - 1
    End If
]

This I have monitored and the data that gets loaded is correct.

But, when I go to the "Design" module on a different Activity and select a "Pi" from the Combobox, it has changed the decimal value of the Coordinates.

[CODE lang="b4x" title="Selecting a Pi (Point of Intersection)"][/
Sub Load_Hor
    HorNo.Clear
    ResultSet = CGlobals.SQL1.ExecQuery("SELECT No FROM HorPi")
    Rec=0
    Do While ResultSet.NextRow
        Rec=Rec+1
        HorNo.Add(ResultSet.GetString("No"))
    Loop
    Rec=Rec + 1
    HorNo.Add(Rec)
    HorNo.SelectedIndex = Rec-1
    ResultSet.Close            'close
End Sub

Sub HorNo_ItemClick (Position As Int, Value As Object)
    WorkItem = HorNo.SelectedItem
    Try
        Query = "SELECT * FROM HorPi WHERE No = ?"
        ResultSet =CGlobals.SQL1.ExecQuery2(Query, Array As String (WorkItem))
        ResultSet.NextRow
        HorStartSV.Text = NumberFormat2(ResultSet.GetString("StartSV"),1,3,3,False)
        HorYCoord.Text = NumberFormat2(ResultSet.GetString("PiYCoord"),1,3,3,False)
        HorXCoord.Text = NumberFormat2(ResultSet.GetString("PiXCoord"),1,3,3,False)
        HorRadius.Text = NumberFormat2(ResultSet.GetString("Radius"),1,3,3,False)
        TransIn.Text = NumberFormat2(ResultSet.GetString("TransIn"),1,3,3,False)
        TransOut.Text = NumberFormat2(ResultSet.GetString("TransOut"),1,3,3,False)
        CGlobals.StartStake = HorStartSV.Text
    Catch
        Clean_HorText
    End Try
    ResultSet.Close
End Sub
]

Any hint please?
 
Top