I did do a find for every evidence of the "cards" and I discovered in the LoadCards section, this:
I have removed the word "cards" from that sub, as well as in the DealRedCard sub.Code:Private Function DealBlueCard(Ctrl As Control, OldSlot As Integer) As Integer Dim i As Integer, X As Integer i = CurrentBlueSlot Do While BlueCards(currentCard) > 51 currentCard = currentCard + 1 If currentCard > 53 Then ShuffleBlueCards Loop Ctrl.Picture = BlueCards(currentCard) Picture1.AutoRedraw = True Picture1.PaintPicture Ctrl.Picture, Ctrl.Left, Ctrl.Top Picture1.AutoRedraw = False Ctrl.Tag = cards(BlueCards(currentCard)) currentCard = currentCard + 1 If currentCard > 52 Then ShuffleBlueCards 'Note I changed this to 52 (that's correct right?) Me.Refresh DealBlueCard = Ctrl.Tag Mod 13 End Function
I also discovered in what used to be the LoadCards sub, the word "cards" appears again (twice over):
I have created two separate subs and replaced the word "cards" with their corresponding colours:Code:Private Sub LoadCards(sPath As String) Dim i As Integer, lstr As String For i = 0 To 51 lstr = App.Path & "\" & sPath & "\" & Choose(Int(i / 13) + 1, "s", "c", "h", "d") & _ Trim(Mid(" 2 3 4 5 6 7 8 910 j q k a", (i Mod 13) * 2 + 1, 2)) & ".bmp" Set cards(i) = New StdPicture Set cards(i) = LoadPicture(lstr) Next End Sub
Code:Private Sub LoadBlueCards(sPath As String) Dim i As Integer, lstr As String For i = 0 To 51 lstr = App.Path & "\" & sPath & "\" & Choose(Int(i / 13) + 1, "s", "c", "h", "d") & _ Trim(Mid(" 2 3 4 5 6 7 8 910 j q k a", (i Mod 13) * 2 + 1, 2)) & ".bmp" Set BlueCards(i) = New StdPicture Set BlueCards(i) = LoadPicture(lstr) Next End Sub Private Sub LoadRedCards(sPath As String) Dim i As Integer, lstr As String For i = 0 To 51 lstr = App.Path & "\" & sPath & "\" & Choose(Int(i / 13) + 1, "s", "c", "h", "d") & _ Trim(Mid(" 2 3 4 5 6 7 8 910 j q k a", (i Mod 13) * 2 + 1, 2)) & ".bmp" Set RedCards(i) = New StdPicture Set RedCards(i) = LoadPicture(lstr) Next End Sub




Reply With Quote