SRL Archive - OSR Help

repeat until


lolhahauad

2011-12-11 00:47:13

this is my main loop

begin
SetUpSrl;
repeat
kick;
until(300);
end.

however it doesnt work, i know if i put true/false in the until line then it would work, but how do i make it repeat itself until a certain amount of time?

RISK

2011-12-11 00:50:41

Try this:
procedure Example;
var
T : Integer;
begin
MarkTime(T);

while (TimeFromMark(T) < 1500) do
begin
Wait(100);
end;

WriteLn(ToStr(T));
end;

lolhahauad

2011-12-11 00:57:54

mind explaing what each code does?

RISK

2011-12-11 01:00:01

Here:
procedure Example;
var
T : Integer; // Makes "T" an integer
begin
MarkTime(T); // Uses the integer "T" to mark the time that has passed in milliseconds

while (TimeFromMark(T) < 1500) do // While the value (The time) of integer "T"
begin // is less than "1500", do this:
Wait(100); // Waits 100 milliseconds
end;

WriteLn(ToStr(T)); // Writes the value of "T"
end;