#2
sdta2024-06-26 17:44
|
只有本站会员才能查看附件,请 登录
程序代码:
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 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编辑过]