Android Question Error codes

David Troup

Member
Licensed User
Longtime User
I have input:-
"Dim m, n1, n2, n3, n4, n5, n6 As Int"
and get a dialogue box:- "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name index."
Is there anywhere in the documentation which explains these messages, gives examples of where it is wrong and a course of action to remedy the error?
Kind regards,
David.
 

DonManfred

Expert
Licensed User
Longtime User
the size of your list is for ex 10 but you want to use index 11 -> Listindex out of bounds error

You should post more code to let us understand the situation more in details...
 
Upvote 0

David Troup

Member
Licensed User
Longtime User
Hi Manfred,
I think the relevant bit is as below:_
I am a complete novice to this and do not understand your reference to "ex 10" & "index 11". I'm afraid it will have to be explained to me in very simple terms.
Kind regards,
David.

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

Dim m, n1, n2, n3, n4, n5, n6, As Int

Rnd()
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
PrivateButton1AsButton
PrivateButton2AsButton
PrivateButton3AsButton
PrivateCheckBox1AsCheckBox
PrivateCheckBox2AsCheckBox
PrivateCheckBox3AsCheckBox
PrivateCheckBox4AsCheckBox
PrivateCheckBox5AsCheckBox
PrivateImageView1AsImageView
PrivateImageView2AsImageView
PrivateImageView3AsImageView
PrivateImageView4AsImageView
PrivateImageView5AsImageView
End Sub

Sub Activity_Create(FirstTimeAsBoolean)
Activity.LoadLayout("LDMain")
Dim Timer1 As Timer
Timer1.Initialize("Timer1",1000)
Timer1.Enabled = True
Sub
m = m + 10
If m < 200 Then
n1 = Rnd(1, 5)
n2 = Rnd(1, 5)
n3 = Rnd(1, 5)
n4 = Rnd(1, 5)
n5 = Rnd(1, 5)
n6 = Rnd(1, 5)
 
Upvote 0
Top