运行修饰,补齐错误
运行修饰,程序自动将第4行后的bj,自动补齐为bjmc,如果去掉第4行就不会出现这个错误,为什么回这样,vfp版本9.0sp1
cj.rar
(8.92 KB)
程序代码:
Clea Close Databases Use cj In 0 Blank Fields bjmc, njmc All&&&测试用 *Browse&&&测试用 Select Distinct zf,0000 pm From cj Order By zf Desc Into Cursor tpm Readwrite Update tpm Set pm=Recno() Update cj Set cj.njmc=tpm.pm From tpm Where cj.zf=tpm.zf Select cj Select Distinct bj From cj Into Array abj *?Alen(abj)&&&测试用 For i=1 To Alen(abj) *?abj[i]&&&测试用 Select Distinct zf,0000 pm From cj Order By zf Desc Where Alltrim(cj.bj)=abj[i] Into Cursor tbj1 Readwrite Update tbj1 Set pm=Recno() *SELECT tbj1&&&测试用 *BROWSE&&&测试用 Update cj Set cj.bjmc=tbj1.pm From tbj1 Where cj.zf=tbj1.zf And Alltrim(cj.bj)=abj[i] Endfor Select * Order By zf Desc,bjmc From cj&&&测试用
修饰后变成这样
Close Databases
Use cj In 0
Blank Fields bjmc, njmc All&&&测试用
*Browse&&&测试用
Select Distinct zf,0000 pm From cj Order By zf Desc Into Cursor tpm Readwrite
Update tpm Set pm=Recno()
Update cj Set cj.njmc=tpm.pm From tpm Where cj.zf=tpm.zf
Select cj
Select Distinct bjmc From cj Into Array abj
*?Alen(abj)&&&测试用
For i=1 To Alen(abj)
*?abj[i]&&&测试用
Select Distinct zf,0000 pm From cj Order By zf Desc Where Alltrim(cj.bjmc)=abj[i] Into Cursor tbj1 Readwrite
Update tbj1 Set pm=Recno()
*SELECT tbj1&&&测试用
*BROWSE&&&测试用
Update cj Set cj.bjmc=tbj1.pm From tbj1 Where cj.zf=tbj1.zf And Alltrim(cj.bjmc)=abj[i]
Endfor
Select * Order By zf Desc,bjmc From cj&&&测试用
[此贴子已经被作者于2024-6-26 16:53编辑过]