ok but ist the same also when i put
Delphi-Quellcode:
function TBinTree.FindMin(init:boolean):integer;
begin
if init then result:=self.Value;
//ShowMessage('val '+ValToStr+' res'+inttostr(result));
if value<result then
begin
result:=value;
end;
if not(left=nil) then result:=left.FindMin(false);
if not(right=nil) then result:=right.FindMin(false);
end;
value is always inicializes and result now too, but why the result changes besides on ShowMessage (again it gives the right value when i dont hide the showmessage dialog)