bsirhell 发表于 2006-11-9 23:24:00

[求助]此函数错在哪?

<SPAN class=bold>此函数错在哪?</SPAN><BR><BR>Function getmaxy(ptarr(), y As Double) As Variant<BR>For i = 0 To UBound(ptarr)<BR>For j = UBound(ptarr) To LBound(ptarr) Step -1<BR>&nbsp; &nbsp;If ptarr(i)(1) = y And ptarr(j)(1) = y Then<BR>&nbsp; &nbsp;If ptarr(j)(0) &gt;= ptarr(i)(0) Then<BR>&nbsp; &nbsp;max = ptarr(j)<BR>&nbsp; &nbsp;End If<BR>&nbsp; &nbsp;End If<BR>Next j<BR>Next i<BR>getmaxy = max<BR>End Function<BR>我想实现的是从一个点组中,获得与一个Double类型数值Y相同点,然后找出这些具有相同Y坐标中的最大点<BR>而这个函数找到的点明显不对,是可原因?
页: [1]
查看完整版本: [求助]此函数错在哪?