我想提取符合上面条件的点怎么不行啊
Private Sub Command6_Click()
Open "D:/.shujutxt"For Input As #1
dim a() as single,i as integer,j as integer
f = 0
For i = 1 To 5
For j = 1 To 5
Input #1, a(i, j)
If (((a(i,j-1)-a(i,j))*(a(i,j+1)-a(i,j)))>0) and (a(i,j+1)<a(i,j)) Then f = 1
if (((a(i-1,j)-a(i,j))*(a(i+1,j)-a(i,j)))>0) and (a(i+1,j)<a(i,j)) Then f = 1
If (((a(i,j-1)-a(i,j))*(a(i,j+1)-a(i,j)))>0) and (a(i,j+1)>a(i,j)) Then f = -1
if (((a(i-1,j)-a(i,j))*(a(i+1,j)-a(i,j)))>0) and (a(i+1,j)>a(i,j)) Then f = -1
if f=1 then a(i,j)=1
If f =-1 Then a(i, j)=-1
print a(i,j)
nextj
next i
End sub
我想提取符合上面条件的点怎么不行啊,请指点,谢谢。