The code below is suppose to randomly load one of the pictures
in the variable computer and send it to piccpu.picture property.
However, it is not working can someone help me and tell me what
to add or change to make the code work properly, Thanks GOD BLESS!
vbcode:
Public Function Rand(ByVal Low As Long, ByVal high As Long) As Long
Rand = Int((high - Low + 1) * Rnd) + Low
End Function
Sub opponent()
Dim computer(1 To 3) As Variant
computer(1) = LoadPicture(App.Path & "\carl.bmp")
computer(2) = LoadPicture(App.Path & "\antonio.bmp")
computer(3) = LoadPicture(App.Path & "\thomas.bmp")
piccpu.picture = computer(Rand(1, 3))
End Sub
Private Sub Form_Load()
opponent
End Sub
