Compiler directives: #err

Syntax

#err

 

Syntax2

#err nlines

 

Syntax3

#err function

 

Parameters

nlines - number of lines to skip if error does not occur. Digits.

function - name of user-defined function.

 

Remarks

Handles compile-time error generated in previous statement.

 

Syntax1: On error, continue. Error is not generated, and statement with error is excluded.

 

Syntax2: On error, compile following nlines lines. If error does not occur, following nlines lines are skipped. If nlines is 0, on error all following code is not compiled.

 

Syntax3: On error, call function. It runs synchronously (at compile time) in QM main thread. If it returns 0, error is generated as usually. If 1, error is not generated, and statement with error is excluded (same as #err). If -1, error is generated but not displayed. If -2, error is not generated, and all following code is not compiled (same as #err 0).

 

Special variable _error is filled with information about error, and function function can access it. Currently, code is always 0 on compile-time errors.

 

See also: errors, err

 

Examples

dll somedll DllFunctionThatMayBeMissing a b c
#err SayNoFunction

typelib VBScript_RegExp {3F4DACA7-160D-11D2-A8E9-00104B365C9F} 1.0
#err 1
typelib VBScript_RegExp {3F4DACA7-160D-11D2-A8E9-00104B365C9F} 0.0