Results 1 to 6 of 6

Thread: PLEASE HELP!!!!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Elmwood, NE
    Posts
    2
    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.

  2. #2
    Guest
    If you want to exit the sub, use Exit Sub

  3. #3
    Junior Member
    Join Date
    Dec 1999
    Posts
    25

    Cool 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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Elmwood, NE
    Posts
    2
    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.

  5. #5
    Guest
    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

  6. #6
    Junior Member
    Join Date
    Dec 1999
    Posts
    25

    Talking 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
  •  



Click Here to Expand Forum to Full Width