[SOLVED] How do I return/interrupt a parent function?

 

Sorry, this must have been asked many times, but I still can't find it on my own.


void BailOut() {

Print("Emergency! Abort!");

return;

}


void mainFunction() {

if (bool NuclearWarfare == 1) {

BailOut();

}


Of course, it's an oversimplification of what I want, but it should be clear enough.

The return statement inside the BailOut(); function causes THAT function to terminate. But I want it to be able to cause mainFunction() to terminate. Can I do that?


TIA

 

In case of nuclear warfare, nobody cares about THAT

 

Typically you'd do something like...

bool bailOut() {
    Print("Emergency! Abort!");
    return true;
}

void mainFunction() {
    if (bailOut())
        return;
}
 
nicholi shen:

Typically you'd do something like...

Excellent. Thank you!
 
You might want to add an ExpertRemove() in case you need to stop the EA.
Reason: