What happens if the text passed to the Eval function (textToEval string) generates an error?
In this case the value of the third parameter (resume, left to its default value, false, in the previous examples) is crucial. If an error is generated the following applies:
resume is false: we can control if Eval will interrupt our script using the error.Resume function in the textToEval string with the usual error handling rules. Notice that some errors will interrupt code execution even if error.Resume has been called, as e.g. the Err_BadSyntax error. In any case, the code line after the call to the Eval function the global variable err will contain the code of the generated error.
resume is true: the Eval function will interrupt the execution of the text contained in textToEval according to the error handling rules, but, instead of interrupting the execution of the calling script upon an error, will return the name of the generated error in the return string. In any case, on the code line after the call to the Eval function the global variable err will contain the code of the generated error.