Link to home
Start Free TrialLog in
Avatar of XK8ER
XK8ERFlag for United States of America

asked on

function in vb.net

hello there,
Im trying to convert this little peace of code to vb.net can someone help me out please..
thanks
<?PHP
$checkthisnumber = 100;
$i=1;
while ($i < 151) 
{
        
 if ($i == $checkthisnumber) 
        {
                echo "number found,: ". $checkthisnumber;
		break;
        } else {
                echo $i." was not found";
        }
$i++;
}
 
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi XK8ER;

This snippet should do the same thing.

Fernando

Dim checkthisnumber As Integer = 100
Dim i As Integer = 1
 
While i < 151
    If i = checkthisnumber Then
        Console.WriteLine("number found,: " & checkthisnumber.ToString())
    Else
        Console.WriteLine(i.ToString() & " was not found")
    End If
    i += 1
End While

Open in new window