SRL Archive - Help and Support

4t7ack 0f th3 Exc3p71ons! RAWR! (Ub3r h3lp needed)


R0b0t1

2007-08-10 04:53:27

I was browsing the SCAR manual when, oh and behold, I found:

From: Teh m4nu4l

procedure RaiseLastException;

procedure RaiseException(Ex: TIFException; Param: string);

function ExceptionType: TIFException;

function ExceptionParam: string;

function ExceptionProc: Cardinal;

function ExceptionPos: Cardinal;

function ExceptionToString(er: TIFException; Param: string): string;


And I was like: R4rW! wh4t 3s t15 shizzl3?

And then I made this thread.

And then I was like Woah.

And then I ask a question.

Which is, what are these? Are they ways to create errors without doing something wrong (I've done this in python..)? I think this could be useful to help stop leechers with my "Include SRL stats in all scripts and check if they are member, or if they even enter it" idea but bring it to a new level.

If they aren't useful for stuff, I'd still l1ke to know since kn0wledge is power.


Smrtp3epz! I n3edz y0 h3lpz!

~alex~

2007-08-10 05:08:33

Its just like python :P… and java… and many other languages.

The Claw

2007-08-10 09:22:11

speak english then try again, cause i seriously cant be bothered trying to figure out what youre on about

Bobarkinator

2007-08-10 10:30:36

I think I got the general idea, if you know Java then it's looks to be the throws statement.

n3ss3s

2007-08-10 11:18:48

:O Do you mean we could avoid exceptions with that too?
For example Try - Except = Java's Try - Catch

Bobarkinator

2007-08-10 15:20:27

From: n3ss3s
:O Do you mean we could avoid exceptions with that too?
For example Try - Except = Java's Try - Catch


We've always been able to do that

R0b0t1

2007-08-10 16:06:37

English version:

I just want to know what these are for. Like, can I create errors with them if I know how to? And if you know them, what are the params?

Pancakes

2007-08-10 22:34:02

From: r0b0t1
English version:

I just want to know what these are for. Like, can I create errors with them if I know how to? And if you know them, what are the params?



Why would you want to do that again?
:confused:

Wanted

2007-08-10 22:54:06

If it's noobs your after just do something like,

begin
ClearDeBug;
WriteLn('Line 3: [Error] (3:1): Unknown identifier ''xDTMAnglated'' in script');
TerminateScript;
end.

R0b0t1

2007-08-11 00:31:53

Nah, I want the cool factor when I create errors :p

shaunthasheep

2007-08-11 08:19:50

  RaiseException(erCustomError, 'The_Rs_Monkey Is 1337');
[Runtime Error] : The_Rs_Monkey Is 1337 in line 17 in script
and all the TIFExceptions are:

erCannotImport
erCouldNotCallProc
erDivideByZero
erException
erInterfaceNotSupported
erInvalidHeader
erInvalidOpcode
erInvalidOpcodeParameter
erInvalidType
erMathError
erNoError
erNoMainProc
erNullPointerException
erNullVariantError
erOutOfGlobalVarsRange
erOutOfMemory
erOutOfProcRange
erOutOfRange
erOutOfRecordRanger
erOutOfStackRange
erTypeMismatch
erUnexpectedEof
erVersionError


btw i couldn't get RaiseLastException; to work, even in a try loop after an error =S, the other procedures hold the variables of the last exception and one turns rhe error into a string.

Santa_Clause

2007-08-11 09:36:34

What the…I wonder why this was implemented into SCAR in the first place..

Santa_Clause

2007-08-11 09:46:12

It would have enlightened me a bit more if you actually answered my question…

Bobarkinator

2007-08-11 10:19:15

So that if you detect something in your script has gone wrong you can raise your own error and terminate script instead of just terminating script because you can know why it terminated.