Bonjour

J'ai un comportement different quand le lance un programme à partir de l'ide ou quand je compile et lance l'executable

Voici le code

( Pas trouvé ne devrait jamais s'afficher et il s'ffiche seulement à partir de l'exe , mais jamais quand je lance a partir de ide)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Private Function Action(PointsJoueur As Integer) As String
    Action = "Pas trouvé"
    If Joueurs(JNum).Carte1 = Joueurs(JNum).Carte2 And Joueurs(JNum).Cartes = 2 Then
        Action = Partage(PointsJoueur)
        Exit Function
    End If
    If Joueurs(JNum).Max = Joueurs(JNum).Min Then          'Hard hand
        Select Case PointsJoueur
            Case 2, 3, 4
                Action = "T"
            Case 5, 6, 7
                If Joueurs(0).Max = 11 And Joueurs(JNum).Cartes = 2 Then Action = "A" Else Action = "T"
            Case 8
                Action = "T"
            Case 9
                Select Case Joueurs(0).Max
                    Case 2, 7, 8, 9, 10, 11
                        Action = "T"
                    Case 3, 4, 5, 6
                        Action = "D"
                End Select
            Case 10, 11
                If Joueurs(0).Max < 10 And Joueurs(JNum).Cartes = 2 Then Action = "D" Else Action = "T"
            Case 12, 13
                Select Case Joueurs(0).Max
                    Case 2, 3, 4, 5, 6
                        Action = "R"
                    Case 7, 8, 9, 10
                        Action = "T"
                    Case 11
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "A"
                        Else: Action = "T"
                        End If
                End Select
            Case 14, 15
                Select Case Joueurs(0).Max
                    Case 2, 3, 4, 5, 6
                        Action = "R"
                    Case 7, 8, 9
                        Action = "T"
                    Case 10, 11
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "A"
                        Else: Action = "T"
                        End If
                End Select
            Case 16
                Select Case Joueurs(0).Max
                    Case 2, 3, 4, 5, 6
                        Action = "R"
                    Case 7, 8
                        Action = "T"
                    Case 9, 10, 11
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "A"
                        Else: Action = "T"
                        End If
                End Select
            Case 17
                If Joueurs(0).Max < 11 Then
                    Action = "R"
                Else: Action = "A"
                End If
            Case 18, 19, 20, 21
                Action = "R"
        End Select
    Else                                                   ' soft hand
        Select Case PointsJoueur
            Case 13, 14
                Select Case Joueurs(0).Max
                    Case 2, 3, 4, 7, 8, 9, 10, 11
                        Action = "T"
                    Case 5, 6
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "D"
                        Else: Action = "T"
                        End If
                End Select
            Case 15, 16
                Select Case Joueurs(0).Max
                    Case 2, 3, 7, 8, 9, 10, 11
                        Action = "T"
                    Case 4, 5, 6
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "D"
                        Else: Action = "T"
                        End If
                End Select
            Case 17
                Select Case Joueurs(0).Max
                    Case 2, 7, 8, 9, 10, 11
                        Action = "T"
                    Case 3, 4, 5, 6
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "D"
                        Else: Action = "T"
                        End If
                End Select
            Case 18
                Select Case Joueurs(0).Max
                    Case 2, 7, 8
                        Action = "R"
                    Case 3, 4, 5, 6
                        If Joueurs(JNum).Cartes = 2 Then
                            Action = "D"
                        Else: Action = "T"
                        End If
                    Case 9, 10, 11
                        Action = "T"
                End Select
            Case 19, 20, 21
                Action = "R"
            Case Is > 21
                Action = "R"
        End Select
    End If
    If Action = "Pas trouvé" Then MsgBox Action & vbCrLf & Str(Joueurs(JNum).Max) & vbCrLf & Str(Joueurs(0).Max), vbOKOnly
End Function