以下是引用sdta在2023-2-28 18:05:37的发言:
* VFP9 代码
CLOSE DATABASES
SELECT * FROM DBF\aa ORDER BY bkzydm, zf DESC INTO CURSOR temp READWRITE
BLANK FIELDS pm, bl ALL
lczydm = SPACE(0)
lnzf = 0
lnzrs = 0
SCAN
lnzrs = lnzrs + 1
IF bkzydm == lczydm
IF zf != lnzf
lnmc = lnzrs
lntf = 1
ELSE
lntf = lntf + 1
ENDIF
ELSE
lnmc = 1
lnzrs = 1
lntf = 1
ENDIF
REPLACE pm WITH lnmc, bl WITH lntf
lczydm = bkzydm
lnzf = zf
lnmc = pm
ENDSCAN
BROWSE
* VFP9 代码
CLOSE DATABASES
SELECT * FROM DBF\aa ORDER BY bkzydm, zf DESC INTO CURSOR temp READWRITE
BLANK FIELDS pm, bl ALL
lczydm = SPACE(0)
lnzf = 0
lnzrs = 0
SCAN
lnzrs = lnzrs + 1
IF bkzydm == lczydm
IF zf != lnzf
lnmc = lnzrs
lntf = 1
ELSE
lntf = lntf + 1
ENDIF
ELSE
lnmc = 1
lnzrs = 1
lntf = 1
ENDIF
REPLACE pm WITH lnmc, bl WITH lntf
lczydm = bkzydm
lnzf = zf
lnmc = pm
ENDSCAN
BROWSE
并列人数这边还是不准确,谢谢