hmmm, versuch's mal so ... ich c1 un cur sind ja eingenständige Variablen, in denen die Pointer gespeichert werden, also haben @c1 und @cur auch immer unterschiedliche Adressen.
Delphi-Quellcode:
var c1,c2 : TComponent;
b : boolean;
function muh : [color=#ff0000]Pointer[/color];
begin
result := nil;
if b then
result := [color=#ff0000]@[/color]c1
else
result := [color=#ff0000]@[/color]c2;
end;
procedure TForm1.Button1Click(Sender: TObject);
var cur : Pointer;
begin
b := true;
cur := muh;
if @c1 <> cur then showmessage('ungleich');
end;
oder so
Delphi-Quellcode:
var c1,c2 : TComponent;
b : boolean;
function muh : TComponent;
begin
result := nil;
if b then
result := c1
else
result := c2;
end;
procedure TForm1.Button1Click(Sender: TObject);
var cur : TComponent;
begin
b := true;
cur := muh;
if c1 <> cur then showmessage('ungleich');
end;
Ein Therapeut entspricht 1024 Gigapeut.