Android Question Code not running in code module

AndrewF

Member
Licensed User
Longtime User
Hi,

I hope I'm not missing the obvious here but I have made changes to a code module after creating it in another app, loaded it into this program and tried to make further changes. I've saved it, closed the app and reloaded the code modules and whilst may changes appear in the correct place the do not run and the old code which is not visible in the code module is running when I view events in the code module.

Here is a sub routine from the code module:

B4X:
' end of sub that is running correctly
   
GetScreenGroups

End Sub
Public Sub GetScreenGroups

 DBUtils.DropTable(SQL1, "ScreenGroups")

Dim SQLSTR As String
    Dim myno As Int
    ' merge Products and models
    SQLSTR="Select CategoryID, Listorder, CategoryName from Categories "
    Dim Cursor1 As Cursor
    Dim ScreenGroupID() As Int
    Dim ListOrder() As Int
    Dim ScreenGroupName() As String
   
    Dim myno As Int
    myno = 0
    Cursor1 = SQL1.ExecQuery(SQLSTR)
   
 Cursor1.Position=0
    For i = 0 To Cursor1.RowCount -1
       
            ScreenGroupID(i)=Cursor1.GetInt("CategoryID")
            ListOrder(i)=Cursor1.GetInt("ListOrder")
            ScreenGroupName(i)=Cursor1.GetInt("CategoryName")
            myno = myno+1
           
 Next

   
   
   

                            Dim m As Map
    m.Initialize
    m.Put("ScreenGroupNo", DBUtils.DB_INTEGER)
    m.Put("ListOrder", DBUtils.DB_INTEGER)
    m.Put("ScreenGroupName", DBUtils.DB_TEXT)
    DBUtils.CreateTable(SQL1, "ScreenGroups", m, "ScreenGroupNo")
                                    JournalWriter.WriteJournal("Table ScreenGroups Created" ,"System")

               
               
           
Dim ListOfMaps As List
    ListOfMaps.Initialize
    Dim id As Int           
    For i = 1 To myno-1
        Dim m As Map
        m.Initialize
        id = i
    m.Put("ScreenGroupNo", ScreenGroupID(i))
        m.Put("ListOrder", ListOrder(i))
        m.Put("ScreenGroupName", ScreenGroupName(i))

       
        ListOfMaps.Add(m)
    Next
    DBUtils.InsertMaps(SQL1, "ScreenGroups", ListOfMaps)
    JournalWriter.WriteJournal("Inserted records into table ScreenGroups" ,"System")

                   
                   
            ProgressDialogHide   
ToastMessageShow("Completed", True)

The screengroups table for both creation and insertion used to be in a different sub routine, but when I moved it the sub routing does not run.

I have also added this sub to a routine which is working correctly and it also doesn't run. In addition Another database I changed to add an additional column and it is also not running.

During this sequence 8 tables are created and data inserted. All other ones are working correctly, but as above if any change is made the app does not seem to pick it up.
 

stevel05

Expert
Licensed User
Longtime User
Without seeing all of the code I'm going to be guessing, but did you compile the old code module to a library and add that?
 
Upvote 0

AndrewF

Member
Licensed User
Longtime User
Thanks, I think I found it. There was an issue with the code and I think the error handling form dbutils and another code module were handling it
 
Upvote 0
Top