SRL Archive - OSR Help

Raising exceptions in Simba


js3521

2012-10-25 15:46:18

I can't seem to find any documentation on raising exceptions in Simba. I tried compiling the following SCAR script:

begin
raise Exception.Create('Test');
end.

I expected that it might fail because the Exception class doesn't exist or isn't within scope. Instead, it gave me the error "Unknown identifier 'raise' at line 2". Am I right in assuming that the compiler isn't recognizing the 'raise' keyword? If this is the case, is it possible to raise exceptions at all in Simba?

masterBB

2012-10-25 16:02:44

RaiseException(erCustomError, 'hello'); 

possible exceptions:
ErNoError, erCannotImport, erInvalidType, ErInternalError, erInvalidHeader, erInvalidOpcode, erInvalidOpcodeParameter, erNoMainProc, erOutOfGlobalVarsRange, erOutOfProcRange, ErOutOfRange, erOutOfStackRange, ErTypeMismatch, erUnexpectedEof, erVersionError, ErDivideByZero, ErMathError,erCouldNotCallProc, erOutofRecordRange, erOutOfMemory, erException, erNullPointerException, erNullVariantError, erInterfaceNotSupported, erCustomError

js3521

2012-10-25 16:15:21

Excellent, thanks!

masterBB

2012-10-25 18:21:53

No problem. Never seen anyone use them, mind sharing what you want to do with them?