Results 1 to 6 of 6

Thread: [RESOLVED] Problems with CASE Statements

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    39

    Resolved [RESOLVED] Problems with CASE Statements

    Ok I have a CASE statement in my program and I want to add to conditions onto the end of each selection but for some reason it wont let me.

    Here's my code just now

    VB Code:
    1. Select Case ButtonCounter
    2.         Case 1
    3.           Call Question1
    4.         Case 2
    5.           Call Question2
    6.         Case 3
    7.           Call Question3
    8. .... etc
    9.         End select

    I would LIKE it to look like this

    VB Code:
    1. Select Case ButtonCounter
    2.         Case 1
    3.           Call Question1 [B]And icorrect = 2[/B]
    4.         Case 2
    5.           Call Question2 [B]And icorrect = 3[/B]
    6.         Case 3
    7.           Call Question3 [B]And icorrect = 1[/B]
    8. .... etc
    9.         End select

    For some reason it doesn't like this though and says that there is an "expected end of statement".

    Can someone help me to get this to work?

    Thanks.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Problems with CASE Statements

    Do you mean
    VB Code:
    1. Case (1 And iCorrect = 2)
    ?

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    39

    Re: Problems with CASE Statements

    Quote Originally Posted by penagate
    Do you mean
    VB Code:
    1. Case (1 And iCorrect = 2)
    ?
    Thanks, but it doesn't say to call question one which I need it to do.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Problems with CASE Statements

    Well I left it out... can't you add it yourself?

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    39

    Re: Problems with CASE Statements

    No sorry I get what you mean now, that does work.

    Thanks.

    Noob talking

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Problems with CASE Statements

    No worries.

    Remember to mark your thread as resolved

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