Error Message within a Loop Message

Hello,

I'm working a game called 'Craps' for within VB. I have code for 'Loop' which asks the player, how much stake they would like to place:


On Error GoTo localhandler

Do
Stake = InputBox("Amount", "Betting Stake", "0")

Loop While Stake <= 5 Or Stake >= 11

I would like to place within the an 'Error Message' if player tries to enter:

< = less than or equal to 5
> = Greater than or equal to 11

With just a brief message and an 'OK' button.

Many Thanks.

Comments

  • : Hello,
    :
    : I'm working a game called 'Craps' for within VB. I have code for
    : 'Loop' which asks the player, how much stake they would like to
    : place:
    :
    : [code]
    : On Error GoTo localhandler
    :
    : Do
    : Stake = InputBox("Amount", "Betting Stake", "0")
    : [color=blue]If Stake <= 5 Or Stake >= 11 Then
    MsgBox("Bad stake")
    End If[/color]
    : Loop While Stake <= 5 Or Stake >= 11[/code]
    :
    : I would like to place within the an 'Error Message' if player tries
    : to enter:
    :
    : < = less than or equal to 5
    : > = Greater than or equal to 11
    :
    : With just a brief message and an 'OK' button.
    :
    : Many Thanks.
    :

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion