SELECT fb
a=messagebox("真的要分班吗?",4+32+256,"系统提示")
IF a=6
GO top
*
set filter to xz=alltrim() and zymc=ALLTRIM()
*
locate for xz=alltrim() and zymc=ALLTRIM()
COUNT for xz=ALLTRIM() and zymc=ALLTRIM() to a
a=iif(a%50>0,int(a/50)+1,a/50)
IF a<=1
replace bj with "2014级"+ALLTRIM()+alltrim()+"年"+"班" for xz=ALLTRIM() and zymc=ALLTRIM()
ELSE
set filt to xz=ALLTRIM() and zymc=ALLTRIM()
go top
do while .T.
for n=1 to a
replace bj with "2014级"+ALLTRIM()+alltrim()+"年"+ALLTRIM(STR(n))+"班"
SKIP
if eof()
return
endif
ENDFOR
for m=a to 1 step -1
replace bj with "2014级"+ALLTRIM()+alltrim()+"年"+ALLTRIM(STR(m))+"班"
SKIP
if eof()
return
ENDIF
ENDFOR
ENDDO
ENDIF
MESSAGEBOX("分班成功!",0+48,"系统信息")
ENDIF
UPDATE stu SET stu.bj=fb.bj from fb WHERE stu.sfzh=fb.sfzh
thisform.Refresh
这个是之前按combo1专业名称,combo2学制做的