程序代码:
Create Cursor zl(序号 C(10), 考号 C(200)) Local lcKh, lcId, n lcKh = "" lcId = "" n = 0 Select sy Scan n = n + 1 If n = 1 lcId = Alltrim(sy.xh) lcKh = Transform(sy.Ksh) Else lcKh = lcKh + ";" + Transform(sy.Ksh) * 满十行插入一行到新表 If n = 10 n = 0 && 计数器归零 lcId = lcId + " - " + Alltrim(sy.xh) Insert Into zl(序号, 考号) values(lcId, lcKh) EndIf EndIf EndScan * 收集最后漏掉的零头 If n > 0 Go bottom &&这里要回到表的末尾,不然xh的值为空的,而不是最后一个 lcId = lcId + " - " + Alltrim(sy.xh) Insert Into zl(序号, 考号) values(lcId, lcKh) EndIf Select zl Browse
[此贴子已经被作者于2023-7-11 09:24编辑过]