Public Function setupcards()
'sets the actual deck in suit order used at the start form load
Dim count, x As Integer
'hearts'
For x = 52 To 40 Step -1
deck(x).Index = (x - 39)
deck(x).suit = "hearts"
If (x - 39) < 10 Then
deck(x).value = (x - 39)
End If
If (x - 39) > 10 Then
deck(x).value = 10
End If
Next x
'clubs
For x = 39 To 27 Step -1
deck(x).Index = (x - 26)
deck(x).suit = "clubs"
If (x - 26) < 10 Then
deck(x).value = (x - 26)
End If
If (x - 26) > 10 Then
deck(x).value = (10)
End If
Next x
'diamonds
For x = 26 To 14 Step -1
deck(x).Index = (x - 13)
deck(x).suit = "diamonds"
If (x - 13) < 10 Then
deck(x).value = (x - 13)
End If
If (x - 13) > 10 Then
deck(x).value = (10)
End If
Next x
'spades
For x = 13 To 1 Step -1
If x < 10 Then
deck(x).value = x
End If
If x > 10 Then
deck(x).value = 10
End If
deck(x).Index = x
deck(x).suit = "spades"
Next x
For count = 1 To 52
deck(count).shuffled = False
Next count
'set back of cards
For x = 1 To 52
deck(x).pictureback = path & "ims\cardback.jpg"
Next x
'set front art work
deck(1).picturefront = path & "ims\Aspades.jpg"
deck(2).picturefront = path & "ims\2spades.jpg"
deck(3).picturefront = path & "ims\3spades.jpg"
deck(4).picturefront = path & "ims\4spades.jpg"
deck(5).picturefront = path & "ims\5spades.jpg"
deck(6).picturefront = path & "ims\6spades.jpg"
deck(7).picturefront = path & "ims\7spades.jpg"
deck(8).picturefront = path & "ims\8spades.jpg"
deck(9).picturefront = path & "ims\9spades.jpg"
deck(10).picturefront = path & "ims\10spades.jpg"
deck(11).picturefront = path & "ims\Jspades.jpg"
deck(12).picturefront = path & "ims\Qspades.jpg"
deck(13).picturefront = path & "ims\Kspades.jpg"
deck(14).picturefront = path & "ims\Adiamonds.jpg"
deck(15).picturefront = path & "ims\2Diamonds.jpg"
deck(16).picturefront = path & "ims\3diamonds.jpg"
deck(17).picturefront = path & "ims\4diamonds.jpg"
deck(18).picturefront = path & "ims\5diamonds.jpg"
deck(19).picturefront = path & "ims\6diamonds.jpg"
deck(20).picturefront = path & "ims\7diamonds.jpg"
deck(21).picturefront = path & "ims\8diamonds.jpg"
deck(22).picturefront = path & "ims\9diamonds.jpg"
deck(23).picturefront = path & "ims\10diamonds.jpg"
deck(24).picturefront = path & "ims\Jdiamonds.jpg"
deck(25).picturefront = path & "ims\Qdiamonds.jpg"
deck(26).picturefront = path & "ims\kdiamonds.jpg"
deck(27).picturefront = path & "ims\Aclubs.jpg"
deck(28).picturefront = path & "ims\2clubs.jpg"
deck(29).picturefront = path & "ims\3clubs.jpg"
deck(30).picturefront = path & "ims\4clubs.jpg"
deck(31).picturefront = path & "ims\5clubs.jpg"
deck(32).picturefront = path & "ims\6clubs.jpg"
deck(33).picturefront = path & "ims\7clubs.jpg"
deck(34).picturefront = path & "ims\8clubs.jpg"
deck(35).picturefront = path & "ims\9clubs.jpg"
deck(36).picturefront = path & "ims\10clubs.jpg"
deck(37).picturefront = path & "ims\Jclubs.jpg"
deck(38).picturefront = path & "ims\Qclubs.jpg"
deck(39).picturefront = path & "ims\Kclubs.jpg"
deck(40).picturefront = path & "ims\Ahearts.jpg"
deck(41).picturefront = path & "ims\2hearts.jpg"
deck(42).picturefront = path & "ims\3hearts.jpg"
deck(43).picturefront = path & "ims\4hearts.jpg"
deck(44).picturefront = path & "ims\5hearts.jpg"
deck(45).picturefront = path & "ims\6hearts.jpg"
deck(46).picturefront = path & "ims\7hearts.jpg"
deck(47).picturefront = path & "ims\8hearts.jpg"
deck(48).picturefront = path & "ims\9hearts.jpg"
deck(49).picturefront = path & "ims\10hearts.jpg"
deck(50).picturefront = path & "ims\Jhearts.jpg"
deck(51).picturefront = path & "ims\Qhearts.jpg"
deck(52).picturefront = path & "ims\Khearts.jpg"
End Function