When statement

Hi world,
How do you use "When" statement. What else do you use with it??

THX
Dhruv(BattleGuard)

Comments

  • Hi,

    The When statement can be used in structured error handling. You can set a condition in a Catch branch. For example,
    [code]
    Try
    'Do Something
    Catch ex as Exception When Textbox1.Text = String.Empty
    'When TextBox1 is empty
    Catch
    'When TextBox1 is not empty
    Finally
    'Do something at the end
    End Try
    [/code]
    When an error occurs, execution will go to a different branch depending on the contents of TextBox1

    Hope this helps,

    Chris

    : Hi world,
    : How do you use "When" statement. What else do you use with it??
    :
    : THX
    : Dhruv(BattleGuard)
    :
    :

  • Hi,
    I want, for the pong game, to trigger an event when pongball.top = 232. I want the ball to go the opposite direction. Could you give me teh code for that. That would be nice.

    Dhruv(BattleGuard)


    : Hi,
    :
    : The When statement can be used in structured error handling. You can set a condition in a Catch branch. For example,
    : [code]
    : Try
    : 'Do Something
    : Catch ex as Exception When Textbox1.Text = String.Empty
    : 'When TextBox1 is empty
    : Catch
    : 'When TextBox1 is not empty
    : Finally
    : 'Do something at the end
    : End Try
    : [/code]
    : When an error occurs, execution will go to a different branch depending on the contents of TextBox1
    :
    : Hope this helps,
    :
    : Chris
    :
    : : Hi world,
    : : How do you use "When" statement. What else do you use with it??
    : :
    : : THX
    : : Dhruv(BattleGuard)
    : :
    : :
    :
    :

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