Sub Process_Globals
Dim foList As List
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim poButton As Button
poButton.Initialize("btnEnd")
Activity.AddView(poButton, 10dip, 10dip, 100dip, 50dip)
poButton.Text = "Exit"
End Sub
Sub Activity_Resume
BuildList
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Private Sub btnEnd_Click
Activity.Finish
End Sub
Private Sub BuildList
Dim piIndex As Int
foList.Initialize
For piIndex = 1 To 10
foList.Add(piIndex)
Next
RandomizeListOrder
For piIndex = 0 To foList.Size - 1
Log("Entry #" & piIndex & " contains: " & foList.Get(piIndex))
Next
End Sub
Private Sub RandomizeListOrder
Dim piIndex As Int
Dim piTar As Int
For piIndex = foList.Size - 1 To 0 Step - 1
piTar = Rnd(0, piIndex + 1)
Dim piInt As Int
piInt = foList.Get(piTar)
foList.Set(piTar, foList.Get(piIndex))
foList.Set(piIndex, piInt)
Next
End Sub