Class ErrorFunctions
java.lang.Object
com.scriptbasic.utility.functions.ErrorFunctions
-
Method Summary
-
Method Details
-
error
Throw an exception causing BASIC runtime error. This method can be called directly from BASIC to stop the interpreter with an error condition.- Parameters:
s- the message in the error- Throws:
ScriptBasicException- always
-
asserT
Throw an exception causing BASIC runtime error if the assertion fails. This can be used in the BASIC program to test preconditions and stop the execution of the BASIC program if the condition fails. For example you can writeassert("test that the parameter starts with the required prefix", startsWith(s,prefix))In the example above if the variable
sstarts with the string contained in the variableprefixthen the execution of the BASIC program goes on, otherwise the function causes BASIC runtime error.- Parameters:
s- parameterb- parameter- Throws:
ScriptBasicException- in case of exception
-