Last post Nov 09, 2008 09:55 PM by xBoRISx
Nov 09, 2008 09:11 AM|xBoRISx|LINK
VB.Net 2008\ Asp.Net 3.5
I got code Like this.....
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
dim x as int = 1
dim y as int = 2
dim z as int = 0
if z = 0 then
'I wanted so if z returns 0 i want it to exit from calling the other
'code below this if statement.
if y > 0 then
if x <= 1 then
Nov 09, 2008 09:54 AM|mbanavige|LINK
Nov 09, 2008 10:01 AM|xBoRISx|LINK
Ok what about adding return in the statement or is it "then Exit sub" better way to handle that?
*Aww I see for a single Line use the "Exit Sub". Okay i learned somethign new today thanks [<:o)]
Nov 09, 2008 10:08 AM|mbanavige|LINK
a Return statement could be used to exit out of a Function
For a Sub, you use an Exit
Nov 09, 2008 02:23 PM|DkUltra|LINK
A person could use a case statement eliminating the need for an exit sub
Nov 09, 2008 09:55 PM|xBoRISx|LINK