I have a piece of code that is used by many scripts, so I have transferred it to an include file. This code does a check and throws if it fails. However, I'm finding that it only kills the script that is running inside the include, after which it picks up and starts running the code that originally called the include. This kind of behavior I'm going to call a soft kill. I need the throw() that is included to kill "both" scripts.
Soft kills are typical in other languages but run inside functions, this way you can have a piece of code fail silently. However, it seems throw() inside a function actually hard kills all script running.
Example:
throwTest.jsl
Print("A");
Include("~path\throwTest.include.jsl");
Print("D");
throwTest = Function({}, {Default Local},
Print("E");
throw();
Print("F");
);
throwTest();
Print("G");
throwTest.include.jsl
Print("B");
throw();
Print("C");
Log output:
"A" "B" "D" "E"
Does anyone know how to hard kill JSL from inside an included script?