bud_wis_er_420
2013-02-18 23:27:50
Why is it when I try passing a variable thru the function I'm calling in the WaitFunc() function, I get a Type mismatch error.
I want to do this..
But instead I have to do this…
I want to do this..
program new;
//{$DEFINE SMART}
{$I SRL/SRL.Simba}
function PassVar(i: integer): Boolean;
var
c: integer;
begin
result := false;
c := random(10);
if i = c then
result := true;
end;
Begin
setupSRL;
// () in this function *Error: Type mismatch
if WaitFunc(@PassVar(8), 250, 1000) then
writeln('Found number')
else writeln('Number not found')
End. But instead I have to do this…
program new;
//{$DEFINE SMART}
{$I SRL/SRL.Simba}
function PassVar(i: integer): Boolean;
var
c: integer;
begin
result := false;
c := random(10);
if i = c then
result := true;
end;
function PassVarForward: Boolean;
begin
result := false;
if PassVar(8) then
result := true;
end;
Begin
setupSRL;
// No () in this function
if WaitFunc(@PassVarForward, 250, 1000) then
writeln('Found number')
else writeln('Number not found')
End.