MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | void throw(mixed arg) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | DESCRIPTION |
| 5 | Abort execution. If the current program execution was |
| 6 | initiated by catch(), that catch expression will |
| 7 | return arg as error code. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 8 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 9 | Calling throw() without previous catch() does not make sense |
| 10 | and will result in an ``throw without catch'' error. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 11 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 12 | EXAMPLES |
| 13 | catch(throw("aborting execution")); |
| 14 | This will just print the string "aborting execution". |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 15 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 16 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 17 | catch(E), raise_error(E) |