|
-
Jun 10th, 2000, 03:03 AM
#1
Thread Starter
New Member
Hi. I'm having trouble with a blackjack program I'm writing. I need to know how to prematurely end a sub.
My code is:
Sub cmdStay_Click ()
MyScore
PlayerAce (11,1)
StayClick = StayClick + 1
If SplitClick > 0 then
????????
Elseif SplitClick = 0 then
SplitScore
Endif
cpuDeal
cpuScore1
End Sub
The ??????? is the part I'm unsure about. Can someone PLEEEAAASSSEEE help me.
-
Jun 10th, 2000, 03:08 AM
#2
If you want to exit the sub, use Exit Sub
-
Jun 10th, 2000, 03:12 AM
#3
Junior Member
blackjack game
what exactly do u want it to do when that statement is true? what do u need done in place of the ?????'s. before i can help u i must understand what is being done and whether or not there are any error messages during run time.
-
Jun 11th, 2000, 09:47 AM
#4
Thread Starter
New Member
In place of the ??????, I need the sub to end. I've tried end sub but then it won't continue if the statement is false. The situation is: If the player has split, I need the program to shift down to the next hand if it needs to be done.
-
Jun 11th, 2000, 12:29 PM
#5
Will this work, then you don't even need the Exit Sub statement. If this doesn't work for you, then just use... "Exit Sub" in place of your question marks (without the quotes).
Code:
Sub cmdStay_Click ()
MyScore
PlayerAce (11,1)
StayClick = StayClick + 1
If SplitClick = 0 then
SplitScore
cpuDeal
cpuScore1
End If
'don't know if you need this statement
'depends on if SplitClick will ever be less than 0
If SplitClick < 0 then
cpuDeal
cpuScore1
End If
End Sub
-
Jun 11th, 2000, 05:08 PM
#6
Junior Member
blackjack game
Have you tried Exit Sub instead of End Sub like Megatron suggested.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|