Log in

View Full Version : Script Terminate



Yago
03-02-2011, 10:57 PM
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
03-03-2011, 12:36 AM
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
03-04-2011, 01:48 AM
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
03-04-2011, 02:21 AM
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
03-04-2011, 02:31 AM
Yeah I get it now. Thanks.

Yago
03-21-2011, 02:21 AM
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
03-21-2011, 03:37 AM
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
03-21-2011, 07:36 PM
OK. Thanks.