例:
CREATE CURSOR DB (姓名 C(10), 总成绩 I, 名次 I, 班次 I)
FOR i = 100 TO 1 STEP -1 INSERT INTO DB VALUES (PADL(i, 3, "0"), i, 101-i, 0)
ENDFOR
REPLACE 班次 WITH IIF((名次-1)%8==0 OR (名次-8)%8==0, 1,; IIF((名次-2)%8==0 OR (名次-7)%8==0, 2,; IIF((名次-3)%8==0 OR (名次-6)%8==0, 3,; 4))) ALL
INDEX ON 班次 TAG 班次
GO TOP
BROWSE
RETURN