求数组-最小值时碰到的有关问题

求数组------最小值时碰到的问题?
额要求一个INT数组的最小值,
但是不能是0,0不能算最小值,因为这个数组是这样的:
0,0,0,5,7,8,9,0,0,0,0

如何求出数组最小的值是5,不是0?

不知道我的代码问题在哪,怎么个改?



function GetMinInArray(A: array of Integer): Integer;
var
  I: Integer;
  tmpMin: Integer;
begin
  tmpMin := A[0];

  for I := low(A) to High(A) do
  begin
    if A[i]=0 then
        Continue;
    if A[I] < tmpMin then tmpMin := A[I];
  end;

  Result := tmpMin;
end;

------解决方案--------------------
tmpMin := A[0]; 

这里改成 tmpMin := 10;