Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duh, is there an easy way to stop code?

Status
Not open for further replies.

corchard

Programmer
Jul 3, 2002
23
0
0
CA
I have a very complicated process of functions and code, and wondered if there is an easy way to halt or stop the code midway through the process like Break; does for a loop.

Something like exit or end?

...without causing a javascript error message that is ;-)
 
return; ======================================

if (!succeed) try();
-jeff
 
Thanks Jemminger, I have tried "return false;"

Doesn't return; simply send the step back to the spot the function was called from? and then continue code process?

C
 
corchard,

yes probably...depends on if you have anything depending on the return value of that function.

is "return false;" working for you?
======================================

if (!succeed) try();
-jeff
 
No I'm afraid Return False wasn't working, so I just recoded to validate with an if statement. More code, but probably more reliable in the long run.

Thanks for your help!

C "Illegitimis non carborundum"
(don't let the b@st@rds get you down)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top