Hi all
I have question about how to check the existance of the last list item.
I have added this line, but running the app on a device that doesnt have this list position saved first, will end up in crashing the app..
How to catch this,, and replace by default? or better give error flag?
I have question about how to check the existance of the last list item.
B4X:
TimeSlot_Time = List1.Get(11)
I have added this line, but running the app on a device that doesnt have this list position saved first, will end up in crashing the app..
How to catch this,, and replace by default? or better give error flag?
B4X:
Sub LoadINI
Dim List1 As List
If File.Exists(File.DirRootExternal,FileINI) Then
List1 = File.ReadList(File.DirRootExternal,FileINI)
Timeslot_Spinner1.SelectedIndex = List1.Get(0)
Timeslot_Spinner2.SelectedIndex = List1.Get(1)
Timeslot_Spinner3.SelectedIndex = List1.Get(2)
Timeslot_Spinner4.SelectedIndex = List1.Get(3)
Timeslot_Spinner5.SelectedIndex = List1.Get(4)
Timeslot_Spinner6.SelectedIndex = List1.Get(5)
Timeslot_Spinner7.SelectedIndex = List1.Get(6)
Timeslot_Spinner8.SelectedIndex = List1.Get(7)
Timeslot_Spinner9.SelectedIndex = List1.Get(8)
Timeslot_Spinner10.SelectedIndex = List1.Get(9)
Buzzer_Spinner.SelectedIndex = List1.Get(10)
TimeSlot_Time = List1.Get(11)
End If
End Sub