crazyboybert
Programmer
Hi,
I have a nested function and want to return the outer (parent) function from within the nested (child) function.
e.g
function fncParent(){
if(somecondition) fncChild();
function fncChild(){
someaction;
return; //here i want to return fncParent
}
}
I have tried using fncParent.return; from within fncChild but this gives nasty error. I want to do this to stop the remainder of fncParent executing if fncChild is called at anytime from within it. I know you can exit nested loops using break and that you can do something like
function fncExample(){
outerloop:
for(i=1;i<3;i++){
innerloop:
for(j=1;j<3;j++){
if(j>1) break innerloop; //quit innerloop
if(i==2) break outerloop; //quit outerloop
}
}
}
anybody got any ideas how to do this with nested functions?
any help greatly appreciated
rob
I have a nested function and want to return the outer (parent) function from within the nested (child) function.
e.g
function fncParent(){
if(somecondition) fncChild();
function fncChild(){
someaction;
return; //here i want to return fncParent
}
}
I have tried using fncParent.return; from within fncChild but this gives nasty error. I want to do this to stop the remainder of fncParent executing if fncChild is called at anytime from within it. I know you can exit nested loops using break and that you can do something like
function fncExample(){
outerloop:
for(i=1;i<3;i++){
innerloop:
for(j=1;j<3;j++){
if(j>1) break innerloop; //quit innerloop
if(i==2) break outerloop; //quit outerloop
}
}
}
anybody got any ideas how to do this with nested functions?
any help greatly appreciated
rob