Nexz
12-09-2012, 02:15 AM
function WaitUntil(Something: Boolean): Boolean;
begin
repeat until Something;
Result := True;
end;
The above example will, in case I use it like this:
WaitUntil(FindColor(X, Y, 0, 0, 0, 0, 0));
set
Something: Boolean
to True or False and then do
repeat until Something;
which will loop endlessly because
Something: Boolean
keeps it's value forever.
But what I want is the function WaitUntil to repeat executing
FindColor(X, Y, 0, 0, 0, 0, 0)
every time it checks the value of
Something: Boolean
at
repeat until Something;
so that it would function like:
function WaitUntil2: Boolean;
begin
repeat until FindColor(X, Y, 0, 0, 0, 0, 0);
Result := True;
end;
(but WaitUntil2 doesn't allow you to give any imput like WaitUntil does)
Is it possible, and how?
Ps. I'm sorry if this is a weird post but I don't know how to explain this in a better way and I just got stuck and couldn't find anything about this.
begin
repeat until Something;
Result := True;
end;
The above example will, in case I use it like this:
WaitUntil(FindColor(X, Y, 0, 0, 0, 0, 0));
set
Something: Boolean
to True or False and then do
repeat until Something;
which will loop endlessly because
Something: Boolean
keeps it's value forever.
But what I want is the function WaitUntil to repeat executing
FindColor(X, Y, 0, 0, 0, 0, 0)
every time it checks the value of
Something: Boolean
at
repeat until Something;
so that it would function like:
function WaitUntil2: Boolean;
begin
repeat until FindColor(X, Y, 0, 0, 0, 0, 0);
Result := True;
end;
(but WaitUntil2 doesn't allow you to give any imput like WaitUntil does)
Is it possible, and how?
Ps. I'm sorry if this is a weird post but I don't know how to explain this in a better way and I just got stuck and couldn't find anything about this.