Returns the number of an exception.
iNum = ExceptNum( )
Return | Description |
---|---|
iNum | The number of the exception. INTEGER. |
ExceptNum returns the number of the most recent exception passed as an argument to the raise statement, by a 4Test script, or passed from an exception raised automatically by Silk Test Classic.
Exceptions from Silk Test Classic are assigned negative numbers. To avoid conflicts, use positive numbers for your own exceptions.
Exceptions are defined in 4Test.inc in the Silk Test Classic directory.
[-] testcase ExceptNumExample () [-] do [ ] Verify ("xxx", "yyy") [-] except [ ] Print (ExceptNum () == E_VERIFY) [-] do [ ] raise 1, "My error" [-] except [ ] Print (ExceptNum ()) [-] do [ ] Print ("This will cause an exception. {5/0}") [-] except [ ] Print (ExceptNum () == E_DIVIDE_BY_ZERO) [ ] // Prints: [ ] // TRUE [ ] // 1 [ ] // TRUE