LordJashin
2012-03-11 17:54:09
Custom Errors:
This is what happens in Simba:

Explored example:
[LEFT] [/LEFT]
program CustomError;
begin
RaiseException(erCustomError, 'Epic fail');
WriteLn('haha you failed'); // This line never executes
endThis is what happens in Simba:

Explored example:
program CustomError;
var
ThrowFail : Boolean;
Error: String;
// Some might make their own procedure for Script Termination
procedure FailThem;
begin
WriteLn('Failed to: ' + Error);
//TerminateScript;
end;
begin
Error := 'Find Bitmap';
FailThem;
// Someone might Terminate a script like so
ThrowFail := true;
if ThrowFail then
begin
WriteLn('Failed to $(#*&@%^)$#^%$#');
WriteLn('Terminating Script');
//TerminateScript;
end;
(* Doing this also Terminates the script but has advantages, the
line number is given and highlighted, and using this does a WriteLn
only use this though if there's an error, and your script cannot go
on because of it *)
// This will output: Error: Epic fail at line 35 if ThrowFail is True
if ThrowFail then
RaiseException(erCustomError, 'Epic fail');
WriteLn('haha you failed'); // This line never executes [LEFT] [/LEFT]