Forum: Object-Pascal / Delphi-Language
Delphi
by xaromz,
20. Apr 2006
Hello,
Thanks :) .
Your first piece of code was
if value<result then
Here Result wasn't initialized. Your initializeation followed after that comparison.
Greets
xaromz
Forum: Object-Pascal / Delphi-Language
Delphi
by xaromz,
20. Apr 2006
Hello,
one problem (but not the only one I guess) with your code is that you haven't set the Result prior to comparing it to "Value". So "Result" is undefined.
I think you were trying to do something like this:
function TBinTree.FindMin: Integer;
begin
Result := Value; // Assume current Value is lowest
if Assigned(Left) then
Result := Min(Left.FindMin, Result); // Get lowest...