GetLastError()

Summary

Gets the text of the last error generated by Maptitude.

Changes

The default value of the Reference Info option changed to "False" in Version 5.0.

Syntax

text = GetLastError(array options)

Option Type Contents
Reference Info Boolean "False" (default) to have reference information, otherwise "True"

Returns

A string containing the text of the last error message, or null if there is no error message.

Notes

  • Use GetLastError() to get an appropriate message when trapping errors.

  • GetLastError() may not return an appropriate message if it is called after a Caliper Script function has returned successfully.

  • If the Reference Info option is "False" only the first part of the error message is returned. The "Click OK to continue" and "Reference info:" parts are not returned.

  • If the Reference Info option is "True" you can toggle whether to show the reference information with SetReferenceInfo().

Example

on error do
ShowMessage(GetLastError({{"Reference Info", "False"}}))
Return()
end
CreateBuffers(...)
on error default

See Also

Function Summary
SetReferenceInfo() Toggles showing the reference information when calling GetLastError()
ShowMessage() Shows a message in a standard Windows message box
TaskDialog() Creates an enhanced version of a standard Windows MessageBox
Throw() Causes an error to be raised