Checking the parameter list for errors
Z and I Emulator for Web does not check the parameter list for errors until
the end user plays the macro. When the end user plays the macro, if Z and I Emulator for Web finds
an error in the parameter list, then Z and I Emulator for Web:
- Terminates the macro playback.
- Generates an error message, either by displaying an error dialog box for the end user or by writing a message to the Java console.
Z and I Emulator for Web checks for three types of error situations:
- The specified variable does not exist in the
macro.
In this type of error the parameter list includes a variable name that does not exist in the macro or that is spelled incorrectly (for example,
strLocalfile
instead ofstrLocalFile
).Actions that you can take to avoid this type of problem are as follows:- Warn end users that variable names must be spelled correctly; or
- In the main toolbar, create a customized button that plays the macro with the correct parameter list.
- A syntax error exists in the parameter list.
In this type of error the parameter list contains a syntax error (for example, the value is not enclosed in double quotes).
Actions that you can take to avoid this type of problem are as follows:- Warn end users that syntax rules must be observed; or
- In the main toolbar, create a customized button that plays the macro with the correct parameter list.
Examples of syntax errors gives examples of syntax errors and describes how Z and I Emulator for Web processes the errors: - A run-time error occurs.
An example of a problem in a parameter list that causes a run-time error is the following:
In the example above the variableintLength="abc"
intLength
is of type integer. Z and I Emulator for Web tries to convert the stringabc
to a decimal integer and fails.When a run-time error occurs, Z and I Emulator for Web:- Terminates the macro playback.
- Displays an error dialog box containing the error message.
In the above example of a run-time error, Z and I Emulator for Web displays an error dialog box containing a message such as the following:
A type mismatch occurred while updating variable $intLength$
.