SRL Archive - Help

Compare function pointers/references?


slushpuppy

2012-12-16 01:05:41

Is there a way to do something like this?


function test() : Boolean;
begin
end;

procedure a(Func: function: Boolean);
begin
if @func = test then
blahblah

//or
if @func = @test then
blahblah

end;


Brandon

2012-12-16 01:53:22

Var = reference. Equivalent to addr(X);
@ = address operator.
^V = Pointer to variable of type V.
V^ = Derefence variable V. Aka the Value V holds/points to.

Totally different things. Pascal script does not have true pointer support and thus it is not possible as far as I know, to compare references.

Lape:

var
P: ^Integer;
begin
P := @F;
writeln(P);
writeln(@F);
end.