Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim temp As Int
Dim i As Int = 0
Dim Num(6) As Int
Dim Label1 As Label
Dim Label2 As Label
Dim Label3 As Label
Dim Label4 As Label
Dim Label5 As Label
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")
Dim Results(61) As Boolean
Results(0) = True 'prevent it picking zero
Do While i < 6
temp=Rnd(1,60)
If Results(temp) = True Then Continue ' send it back to pick that one again
Results(temp)=True
Num(i)=temp
i=i+1
pressButton1(i)
Loop
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub pressButton1(b As Double)
'Show the results
Select b
Case 1
Label1.Text = NumberFormat(Num(b),1,0)
Case 2
Label2.Text = NumberFormat(Num(b),1,0)
Case 3
Label3.Text = NumberFormat(Num(b),1,0)
Case 4
Label4.Text = NumberFormat(Num(b),1,0)
Case 5
Label5.Text = NumberFormat(Num(b),1,0)
End Select
End Sub