SRL Archive - OSR Help

Little help...


astoria1112000

2011-12-01 23:37:32

I want to call a procedure after every 25-30 minutes , please help me with it

RISK

2011-12-01 23:41:46

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

procedure Name;
begin
end;

procedure MainLoop;
var T : Integer;
begin
MarkTime(T);

Wait(1500000); // Waits 25 minutes in milliseconds(?)
if (TimeFromMark(T) < 1500000) then Name;
end;

begin
MainLoop;
end.

This is very rough and probably won't work. But it's an idea that you can build off of. Someone will probably provide you with a better procedure though.

E: Realized I used a global variable instead of a local for T. I wonder why…

From: astoria1112000
I want to call a procedure after every 25-30 minutes , please help me with it

astoria1112000

2011-12-01 23:43:44

Please explain, What does MarkTime do and i will make my own method

RISK

2011-12-01 23:49:13

MarkTime(T) will start recording the time that has passed since the mark was made.

Try this for an example:

program new;
{$i SRL/SRL.scar}
var T : Integer;

procedure MainLoop;
begin
MarkTime(T);

Wait(1500); // Waits 1.5 seconds in milliseconds(?)
Write(TimeFromMark(T));
end;

begin
MainLoop;
end.

From: astoria1112000
Please explain, What does MarkTime do and i will make my own method

Flight

2011-12-01 23:50:19


Procedure LetsWait;
var
T: Integer;
begin
MarkTime(T);
While (TimeFromMark(T) < 1500000) do //1 minute = 60000, so 25 minutes = 1500000
Wait(1);
Writeln('25 minutes is up!');
end;

Obviously multiple ways of doing it.

astoria1112000

2011-12-02 00:00:28

k thank you , got it