Results 1 to 15 of 15

Thread: [2005] if...else statements. please help.

Hybrid View

  1. #1
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: [2005] if...else statements. please help.

    By the end of my post, I was favoring what Eclipsyo said, however, that Return would indeed work if exiting the sub that contains the If statement is an appropriate action at that time.
    My usual boring signature: Nothing

  2. #2
    Member
    Join Date
    Apr 2005
    Posts
    58

    Re: [2005] if...else statements. please help.

    Also, if your wanting to check the 1st IF then use a boolean to determine if you want to do another thing..
    Code:
    Dim blnFound as boolean = False
    
     If (TextBox1.Text = "1" Or TextBox1.Text = "2" Or TextBox1.Text = "3") Xor _
            (TextBox2.Text = "1" Or TextBox2.Text = "2" Or TextBox2.Text = "3") Xor _
            (TextBox3.Text = "1" Or TextBox3.Text = "2" Or TextBox3.Text = "3") Xor _
            (TextBox4.Text = "1" Or TextBox4.Text = "2" Or TextBox4.Text = "3") Xor _
            (TextBox5.Text = "1" Or TextBox5.Text = "2" Or TextBox5.Text = "3") = True Then
               blnFound = true
            End If
    
    'now use the blnFound variable to do something else....
    
    IF blnFound THEN 'means if blnFound = True
    
    
            If (TextBox1.Text = "1" Or TextBox1.Text = "2" Or TextBox1.Text = "3") Xor _
            (TextBox2.Text = "1" Or TextBox2.Text = "2" Or TextBox2.Text = "3") Xor _
            (TextBox3.Text = "1" Or TextBox3.Text = "2" Or TextBox3.Text = "3") Xor _
            (TextBox4.Text = "1" Or TextBox4.Text = "2" Or TextBox4.Text = "3") Xor _
            (TextBox5.Text = "1" Or TextBox5.Text = "2" Or TextBox5.Text = "3") Then
                MsgBox("flushplay")
            End If
    
    ELSEIF not blnFound   'means if blnFound = False
    
            If (TextBox1.Text = "1" Or TextBox1.Text = "2" Or TextBox1.Text = "3") Xor _
            (TextBox2.Text = "1" Or TextBox2.Text = "2" Or TextBox2.Text = "3") Xor _
            (TextBox3.Text = "1" Or TextBox3.Text = "2" Or TextBox3.Text = "3") Xor _
            (TextBox9.Text = "1" Or TextBox9.Text = "2" Or TextBox9.Text = "3") Xor _
            (TextBox8.Text = "1" Or TextBox8.Text = "2" Or TextBox8.Text = "3") Then
                MsgBox("flushcomp")
            End If
    END IF
    Just some explains of how to use a boolean as a determination of what to do next.

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