Skip to content

Instantly share code, notes, and snippets.

@X39
Created May 20, 2015 23:00
Show Gist options
  • Save X39/afcd388915f610b34169 to your computer and use it in GitHub Desktop.
Save X39/afcd388915f610b34169 to your computer and use it in GitHub Desktop.
Return concept
foo = {
private["___returnValue___", "___returnedValue___"];
___returnedValue___ = _this call {
scopeName "___returnScope___";
//works only with topMost scope but not lower scopes
if(false) exitWith {false};
if(true) then
{
if(true) then
{
___returnValue___ = false;
breakOut "___returnScope___";
};
};
};
if(!isNil "___returnedValue___") exitWith {___returnedValue___};
___returnValue___
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment