halt script

Maybe is a topic already discussed, but why in Servoy we don’t have the equivalent of FM Halt Script, for stopping definitively a method that calls another one with a return in it?

With return you have at least a equivalent to FMs Exit Script step. That allows you pretty much to do the same.

Servoy uses open standards. Javascript is one of them.
Javascript doesn’t have an equivalent of FMPro’s Halt Script.

But you can still have the same functionality but with some effort.
Example with some pseudo code:

You have 2 methods one calling the other.
myScript1

glob_haltscript = false; // defining a global javascript variable or resetting it when it was already defined before

// your code here
var yourReturnValue = myScript2();
if ( glob_haltscript ) {
	return; // script 2 enabled the haltscript variable, exit this method now.
}
// your code here

myScript2

// your code here
if ( something == notEnough ) {
	// Halt the script;
	glob_haltscript = true;
	return;
} else {
	return myValue;
}

Hope this helps.