Throw()

Summary

Causes an error to be raised.

Changes

Added to Version 5.0.

Syntax

Throw(string text [ ,errortype type_of_error])

Argument Contents
text The string to be displayed in the error message box or returned byGetLastError(), or null for no error message
type_of_error Optional.The type of error that will be thrown. Default is error. See alsoError Handling.

Notes

  • If type_of_error is null, the error can be handled by an On Error statement, otherwise it must be handled with the corresponding error type.

  • Note that the type of error is not a string, but an error data type.

Example

on notfound do
ShowMessage("Encountered a not-found error " + GetLastError())
Return()
end
Throw("an error was raised", notfound)

See Also

Function Summary
GetLastError() Gets the text of the last error generated by Maptitude
SetReferenceInfo() Toggles showing the reference information when calling GetLastError()
Assert() Causes a macro error with the specified string if the test expression is false (0).