SRL Archive - SRL Suggestions

Request WaitFunc(Ex)s


Wanted

2011-02-19 13:38:14

So WaitFunc does not support any type of parameter

I know dg made a WaitFuncEx but it only supported variable argument parameters

Basically I'm asking for a solve all solution where I can use arguments, and inputs.

Something like

WaitFuncEx(Func: function: Boolean; Inputs: TVariantArray; var Arguments: TVariantArray; WaitPerLoop, MaxTime: Integer): Boolean;

Sex

2011-02-19 13:42:45

From here
Could be adapted for what you want it for I guess, same concept.
function AttemptFunction(Func : string; Parameters : TVariantArray; DesiredResult : variant; Attempts, Intermission : integer) : Variant;
var
i : integer;
begin
for i := 1 to Attempts do
begin
try
result := CallProc(Func, Parameters);
except end;
if VarType(result) <> varType(DesiredResult) then
begin
if VarType(result) = varNull then
begin
DesiredResult := True;
result := DesiredResult
end else
begin
Writeln('Error: Type mismatch.');
exit;
end;
end;
if result = DesiredResult then
break;
Wait(Intermission);
if i = Attempts then
result := False;
end;
end;

Wanted

2011-02-19 18:28:34

Ah, CallProc.

I think I can work with that.

Gu3st...

2011-02-19 19:43:55

Wait what..?

You can use CallProc for functions too?! o_O
Gah! This will make my work @ MSI so much easier!!! Thanks a lot! :)

Kinda misleading name though CallProc… Should be renamed to Call() imo