[thelist] exiting out of a function using a nested function
Rich Gray
richardgray at onetel.co.uk
Tue Jul 2 16:52:07 CDT 2002
Tom
Not sure what language you are referring to . ... but anyway
if (!CheckData()) {
exit;
}
or
if (CheckData() == false) {
exit;
}
maybe?
Rich
-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Tom Dell'Aringa
Sent: 02 July 2002 14:27
To: thelist at lists.evolt.org
Subject: [thelist] exiting out of a function using a nested function
'voltsters,
I have a page where some data is being loaded. If that data is not
loaded, I have to stop execution of a function, but I cannot figure
out how to exit out...let me show ya (easier than explaining)
This is what I got:
--------------------
function init()
{
checkData(); // <-- checking to see if the data is present
statements
statements
statements
}
function checkData()
{
if(the data is not there)
{
hey, you have no data!
return false;???
}
}
so the function init() is calling checkData() to see if its there. If
it is not available, I want to STOP executing init(), and exit
altogether.
What I can't figure out is how to pass "false" back to init() from
checkData so I can test on it and use "return" to back out.
Tom
=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list