Update: I think the problem was that I had declared my variables as Object, not Int!
Hi,
I'm getting a strange result when working with a Map which makes me think I am not understanding something properly.
In the watch window approved has value 1 (0x1) and the code goes into the first Else.
mustRefresh is 1 (0x1) so it skips the If (mustRefresh = 0) Then loop
refreshed is 0 (0x0) so I would expect it to go into the If (mustRefresh = 1 AND refreshed = 0) Then loop, but it doesn't!
The fields are all created as type DB_Integer.
Can anyone explain what I am seeing here, please?
Hi,
I'm getting a strange result when working with a Map which makes me think I am not understanding something properly.
B4X:
Dim currentRoute As Map
currentRoute = DBUtils.ExecuteMap(SQLLite, "SELECT srt_approved, srt_mustrefresh, srt_refreshed FROM SelectedRoute", Null)
If currentRoute.IsInitialized Then
approved = currentRoute.Get("srt_approved")
Dim mustRefresh As Object
mustRefresh = currentRoute.Get("srt_mustrefresh")
Dim refreshed As Object
refreshed = currentRoute.Get("srt_refreshed")
If approved = 0 Then
TabManager.setTabEnabled2(tbhMain, True, 1) ' load awbs
TabManager.setTabEnabled2(tbhMain, True, 2) ' approve run sheet
TabManager.setTabEnabled2(tbhMain, False, 3) ' deliver awbs
TabManager.setTabEnabled2(tbhMain, False, 4) ' upload to server
Else
If (mustRefresh = 0) Then
TabManager.setTabEnabled2(tbhMain, False, 1) ' load awbs
TabManager.setTabEnabled2(tbhMain, False, 2) ' approve run sheet
TabManager.setTabEnabled2(tbhMain, True, 3) ' deliver awbs
TabManager.setTabEnabled2(tbhMain, True, 4) ' upload to server
End If
If (mustRefresh = 1 AND refreshed = 0) Then
.
.
.
In the watch window approved has value 1 (0x1) and the code goes into the first Else.
mustRefresh is 1 (0x1) so it skips the If (mustRefresh = 0) Then loop
refreshed is 0 (0x0) so I would expect it to go into the If (mustRefresh = 1 AND refreshed = 0) Then loop, but it doesn't!
The fields are all created as type DB_Integer.
Can anyone explain what I am seeing here, please?