9.8 Errors object
Description
You can enable/disable all error messages with the Error object. Additionally you control the error handling.
List of methods/properties
Name | Type | Short description |
Enable | Method | Enables the error message output system |
Disable | Method | Disables the error message output system |
Resume | Method | Admits multi-line DestinyScripts to continue on errors |
Halt | Method | Admits multi-line DestinyScript to abort on errors |
Catch | Method | Returns the number of the last occured error |
Description
Enables the error message output system. This has no effect on the single disabled errors via the
Error object (this means if an error occurs and it has been disabled with the Error object then there won't be any error message shown).
Syntax
Return value
None
Type
Method
Example
At the end error messages whould be shown if necessary (= default option).
Description
Disables the error message output system. All error messages will be suppressed. This happens even if single errors have been enabled using the
Error object.
Syntax
Return value
None
Type
Method
Example
At the end no error messages whould be shown.
Description
If you call this method then multi-line DestinyScripts will continue running if an error occurs.
Syntax
Return value
None
Type
Method
Example
1
2
3
4
5
$
v[1] = 0;
Errors.Resume();
v[2] = 5 / 0;
v[1] = 5
v[1] whould be at end: 5 (the line 4 raises a "Division by zero" error. The following lines will still be executed!)
Description
If you call this method then multi-line DestinyScripts will abort if an error occurs (= default option).
Syntax
Return value
None
Type
Method
Example
1
2
3
4
5
$
v[1] = 0;
Errors.Halt();
v[2] = 5 / 0;
v[1] = 5
v[1] whould be at end: 0 (the line 4 raises a "Division by zero" error. So the following lines won't be executed!)
Description
This method returns the number of the last occured error. If no error has occured the return value is 0. After a query of this method the number of the last occured error will be reset to 0. If an unknown error occured the return value is -1 (this differs from
ERROR_UNKNOWN which has the value 0).
Syntax
Return value
Dword
Type
Method
Example
In this example two DestinyScripts will run serially, but in two different RPG-Maker comments.
1
2
$
v[1] = Errors.Catch()
v[1] whould be at end: 15 (this is the error number of the "Division by zero" number)