i make button with random number no repeat, but get error
it's my code
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btn(8) As Button
Dim i, k, x,j As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
For i = 0 To 7
btn(i).Initialize("btn")
Activity.AddView(btn(i),5%x,15dip + i*75,80%x,60dip)
btn(i).Text = i
Next
For j = 0 To 7
k = Rnd(j, 7) 'error in this section
x = btn(j).Text
btn(j).Text = btn(k).Text
btn(k).Text = x
Next
End Sub
please help, thank you
it's my code
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim btn(8) As Button
Dim i, k, x,j As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
For i = 0 To 7
btn(i).Initialize("btn")
Activity.AddView(btn(i),5%x,15dip + i*75,80%x,60dip)
btn(i).Text = i
Next
For j = 0 To 7
k = Rnd(j, 7) 'error in this section
x = btn(j).Text
btn(j).Text = btn(k).Text
btn(k).Text = x
Next
End Sub
please help, thank you