My javascript program has reason to want to stop.
For example, function A has 5 lines, the second of which calls function
B, which has 5 lines, the first of which calls function C.
But function C discovers that something is very wrong so it does an
"alert" saying something like
Sorry, couldn't make the necessary connection
At this point, I want the program to STOP rather than returning to
function B.
What can I put in function C after the "alert" to make it STOP completely ?
It's too cumbersome to have to put a special check into function B to
make sure that function C was able to make the required connection (not
to mention function C having to communicate this to function B), plus
having to then also put similar verification into function A etc etc.
It's much easier if I can have functions A and B *assume* that function
C successfully made the connection, and in turn function C causes a real
STOP if it can't make the connection.
In case you're wondering how global a STOP I'm talking about, since
clearly I don't want the entire web browser to stop, let alone the
entire machine (ha ha), notice what happens when a syntax error is
encountered in the middle of a javascript. The browser manages to STOP
the javascript after displaying the error. It's that kind of a STOP I'm
looking for.
(in fact, I was tempted to implement my STOP in a very ugly way, by
intentionally doing some sort of "eval" of a syntactically bogus string,
but I didn't try this yet)
ericosman@rcn.c om 2-Mar-2004
Comment