Syntax |
Err = value |
Description |
Sets the value returned by the Err function to a specific Integer value. |
Comments |
Only positive values less than or equal to 32767 can be used. Setting value to -1 has the side effect of resetting the error state. This allows you to perform error trapping within an error handler. The ability to reset the error handler while within an error trap is not standard Basic. Normally, the error handler is reset only with the Resume, Exit Sub, or Exit Function statement. |
Example |
This example forces error 10, with a subsequent transfer to the TestError label. TestError tests the error and, if not error 55, resets Err to 999 (user-defined error) and returns to the Main subroutine. Sub Main() TestError: |
See Also |
Error (statement); Error Handling (topic). |
E |