Visual Basic Help?

Status
Not open for further replies.

Sledmur

Web-Developer
Nov 29, 2011
459
98
Hey guys!

Well my little brother got me started on Visual Basic, and im currently making a little program I found noone has made. But anyways, Is their a way to do a mutli-conditioned 'if' statement? If so how? Would a loop be better for this? If so why?

-Thanks
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,638
2,393
As far as I'm aware there is two possible ways.

PHP:
<?php
if ( $a == true && $b == true && $c == true )
{
    //do this
}
else
{
    //do that
}
?>

...or...

PHP:
<?php
if ( $a == true )
{
    if ( $b == true )
    {
        if ( $c == true )
        {
            //do this
        }
        else
        {
            //do that
        }
    }
    else
    {
        //do that
    }
}
else
{
    //do that
}
?>
 

xHissy

PHP / VB.net Developer
Oct 23, 2011
75
5
As mark said you can do either of the following


Code:
If A.text = "A" and B.text = "B" Then
    'Make shit happen
End If

Or
Code:
If A.text = "A" Then
If B.text  = "B" Then
  'IF A is A and B Is B do This
 
End If
 
 
    'If A is A and B is not B do this
Else
'A isn't A do this
 
End If
 
Status
Not open for further replies.

Users who are viewing this thread

Top