Errors

See also: compiling and debugging, err, #err.

Compil-time errors

Compile-time errors (when macro syntax is incorrect, variables not declared, etc) are generated when compiling the macro, ie before it starts to execute, or when you click menu Run -> Compile, or when you create exe. Such errors prevent macro from starting to execute. In the QM output is printed error description in form "Error in Macro: error description". These errors are not generated in exe, because there the macro is already compiled.

 

Below are listed some compile-time errors and possible reasons.

Run-time errors

Run-time errors are generated while macro is executed. By default, on a run-time error the macro ends. In the QM output is printed error description in form "Error (RT) in Macro: error description".

 

There are three groups of run-time errors:

1. Errors that are generated by QM ("Window not found", "File not found", etc). Such errors can be handled with the err statement. There are also several fatal errors that cannot be handled, such as a noncompiled function containing syntax errors.

2. Errors that are generated using the end statement. Such errors can be handled with the err statement.

3. Exceptions (errors generated by the operating system or components). In most cases it is result of incorrect programming (invalid pointer, division by 0, endless recursion, etc). Exceptions can by handled with the err statement, but you should avoid them if possible.

 

Below are listed some run-time errors and possible reasons.