SRL Archive - Help

Script Terminate


Yago

2011-03-02 17:57:34

I read one of Naum's tutorials about Script Terminate in SCAR. I was just wondering if it exactly the same in SIMBA too?

Thanks

Flight

2011-03-02 19:36:32

Is this what you're referring to?
AddOnTerminate('Report');
This will call the 'Report' function when the script is manually terminated. This goes in where the main script begins, but before the repeated 'loop' is called.

Yago

2011-03-03 20:48:33

That's a good tactic thanks. Do you put the procedure in parenthesis?

I'm referring to this thread: http://villavu.com/forum/showthread.php?t=41832

Bonfield

2011-03-03 21:21:26

program new;
{$i SRL/SRL.scar}

procedure Report;
begin
writeln('What ever procedure you want.');
end;

begin
AddOnTerminate('Report'); // procedure name goes where Report is

repeat
wait(100);
until IsFKeyDown(7);
end.

does that make sense? if you need help pm me

Yago

2011-03-03 21:31:04

Yeah I get it now. Thanks.

Yago

2011-03-20 22:21:34

Sorry for bringing this up again… but does addonterminate support procedures with parameters because i am getting errors with it once i added a boolean parameter.

Getting this error: Exception in Script: Unknown procedure

Heres my code:

AddOnTerminate('Report(True)');

I dont see anything wrong with it

Nava2

2011-03-20 23:37:40

No, it does not.

Unfortunately, you need to write a wrapper procedure that will call your parameters. Then, pass this new procedure to the AddOnTerminate.

Yago

2011-03-21 15:36:01

OK. Thanks.