What is the execution flow when the program is running? Why I ask is in code, is it step-by-step or does it jump around? 
my app has weird issues which ive posted on before where some code never gets executed and some code does, and its in the same exact subroutine block. I have to move code into other unrelated subroutines that get called in that sub block and the code runs...
Sometimes code will run to update labels in an activity when i havent even ran the code to load the layout yet, and in LOGICAL order the layout load code comes BEFORE the label update code. but sometimes it gets executed bass-ackwards.
Here is an example, Everything is in green comments that explain the issue:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
any ideas?
			
			my app has weird issues which ive posted on before where some code never gets executed and some code does, and its in the same exact subroutine block. I have to move code into other unrelated subroutines that get called in that sub block and the code runs...
Sometimes code will run to update labels in an activity when i havent even ran the code to load the layout yet, and in LOGICAL order the layout load code comes BEFORE the label update code. but sometimes it gets executed bass-ackwards.
Here is an example, Everything is in green comments that explain the issue:
			
				B4X:
			
		
		
		Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
      admin.Initialize("admin")
      serial1.Initialize("serial1")
      If admin.IsInitialized = False Then
         ToastMessageShow("Bluetooth not Installed, Device Unsupported", True)
      End If
   End If   
   Activity.Title = "RCSE ScoreAll"
   'Initialize the panels we use for the pages and put them in the container
   container.Initialize
   
   Activity.SetBackgroundImage(bmp)
   
   Activity.AddMenuItem("Connect","mnuConnect")
   Activity.AddMenuItem("Disconnect","mnuDisconnect")
   Activity.AddMenuItem("DIM", "mnuDimming")                     '<Runs Fine ONLY IF i put these statements here! If i move them at the bottom, it WONT RUN!>
   Activity.AddMenuItem("Clear Board","mnuClear")
   ReadConfig                          '<---Runs Fine
   
   SetDisplay                           '<---Runs Fine
   
   lblHome.Text = NumberFormat(Home, 2, 2)             '<----DOES NOT RUN, and not shit below this runs either....
   lblGuest.Text = NumberFormat(Guest, 2, 2)
   lblDowns.Text = Downs
   lblYds.Text = Yards
   lblTime.Text = NumberFormat(Minutes, 2, 2) & ":" & NumberFormat(Seconds, 2, 2)   '<-----DOES NOT RUN! i know it dont as i had a syntax bug here and the compiler/java did not complain about it, even though i fixed it>
   Dim I As Int
   Select Case Quarter
      Case 1
         rbQuarter0.Checked = True
      Case 2
         rbQuarter1.Checked = True
      Case 3
         rbQuarter2.Checked = True
      Case 4
         rbQuarter3.Checked = True
      Case Else
         rbQuarter0.Checked = False
         rbQuarter1.Checked = False
         rbQuarter2.Checked = False
         rbQuarter3.Checked = False
   End Select
   Select Case Possession
      Case 0
         ImgPossHome.Visible = False
         imgPossGuest.Visible = False
      Case 1
         ImgPossHome.Visible = True
         imgPossGuest.Visible = False
      Case 2
         ImgPossHome.Visible = False     '<none of this shit runs either....>
         imgPossGuest.Visible = True
   End Select
   RefreshTimer.Enabled = True       '<----- DOES NOT RUN... 
   If connected = False Then
      DisableAll                         '<...... DOES RUN... Dont ask me why.. it does. Skips the instruction before it? WTF?>
   End If   
   
End Sub
Sub DisableAll
RefreshTimer.Enabled = True           '<....DOES RUN!, now tell me why it runs here and NOT before calling this sub??????>
'<bunch of other code and things here Snipped> 
End Subany ideas?
			
				Last edited: 
			
		
	
								
								
									
	
								
							
							 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		