回复 18楼 hnwgezhx001
变通一下就OK了,根据你的规律自动循环轮回的。程序代码:
Local nrow,cnum2,ngroup Use "fb分班632人.Dbf" In 0 ALIAS "ctable" Select ctable ngroup=Int(Reccount()/18)+1 nrow=9 Go Top Store "" To cnum1,cnum2 For a=1 To ngroup For b=a To nrow If !Eof() Replace bb With Iif(Mod(b,9)=0,9,Mod(b,9)) cnum2=Alltrim(Str(Iif(Mod(b,9)=0,9,Mod(b,9))))+cnum2 Else Exit Endif Skip 1 Endfor For i=1 To 9 If !Eof() Replace bb With Val(Substr(cnum2,i,1)) Else Exit Endif Skip 1 Endfor Store "" To cnum1,cnum2 nrow=nrow+1 If Eof() Exit Endif Endfor