Errors in Explain™ Scripts
Framework™ detects two basic types of Explain errors.
Type I: compiler error
When a script is loaded into the Framework it is “tokenized”. During this process the script is converted to a form that the Framework’s Explain interpreter can execute. If the Framework finds a section of the script that it cannot tokenize, it reports a compiler error.
A compiler error is reported in a Compile Error dialog box similar to the figure below.
We introduced an intentional syntax error into a script to produce this figure. The title of the error box tells you the name of the file in which the error occurred (ERROR.EXP), and inside the parentheses is the line number (248 in this case). In this example, the error was an IF when the compiler expected a comma.
Type II: Runtime error
A Runtime error occurs as a script is being executed. A runtime error is reported in a different dialog box, similar to the figure below.
Again, we introduced an intentional runtime error into a script to produce this figure. In the brackets, the error box tells you the name of the file in which the error occurred (ERROR.EXP). The number in parentheses after the filename is the line number on which the error was detected (line 31). In the example, the error was a typing mistake in line 31 of the code. “LABEL.New” was typed as “LABEL.Now“. This is a runtime error rather than a compiler error, because the compiler that tokenizes the code assumed that “LABEL.Now” will be defined in a different code module.
The line number reported in either type of error box may not be exact. Continuation lines can confuse the line-number counter. The line number reported in an error box is the line number being compiled or run when the error was detected. The incorrect line that really caused the error may be earlier in the script.
Use the Edit > Goto… command to quickly find the reported error line when you edit the file.
Comments are closed.