CLOSE DATABASES
CREATE CURSOR tt (xh n(4), xm c(200))
USE 姓名列转行 IN 0 ALIAS xm
SELECT xm
lnR = 5 && 设置lnR人为一行
lcStr = ""
lnCnt = 0
SCAN
lcStr = lcStr + "," + ALLTRIM(姓名)
IF
RECNO() = RECCOUNT() OR RECNO() % lnR = 0
lcStr = SUBSTR(lcStr, 2)
lnCnt = lnCnt + 1
INSERT INTO tt VALUES (lnCnt, lcStr)
lcStr = ""
ENDIF
ENDSCAN
SELECT tt
BROWSE
这是以前S大师写的代码