我再试试看 调试下
Select 1
Use 01
Go Top
Do While Eof() = .F.
For i = 1 To 10
a = Field(i)
If &a > 0
For h = 11 To 131
IF i = 10
c = 0
ELSE
c = i
ENDIF
If Alltrim(Str(c))$Field(h)
b = Field(h)
Replace &b With &a
Endif
Endfor
Endif
Endfor
Skip
Enddo
k = 11
Do While k <= 130
a = Field(k)
Go Top
c = 0
Do While Eof() = .f.
IF &a > 0
c = c+1
ELSE
c = 0
Endif
If c > 0 AND &a > 0
Replace &a With c
Endif
Skip
ENDDO
k = k+1
Enddo
你再试试看 这个能满足你的要求