Nexz
2012-12-08 21:15:47
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: Booleanto True or False and then do repeat until Something;which will loop endlessly becauseSomething: Booleankeeps 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 ofSomething: Booleanatrepeat 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.