作者在 2015-02-18 01:23:34 发布以下内容
CREATE CURSOR test (数字 N(5,0))
INSERT INTO test values(7)
INSERT INTO test values(88)
INSERT INTO test values(9)
INSERT INTO test values(8)
INSERT INTO test values(103)
INSERT INTO test values(12)
INSERT INTO test values(11)
INSERT INTO test values(102)
INSERT INTO test values(101)
Sort To test_order_A On 数字
Create Cursor test1 (数字 N(5,0),起 I,止 I)
APPEND FROM test_order_A
Go Top
lnNum=数字
Scan For Recno()>1
lnNum1=数字-lnNum
If lnNum1>1
Replace 起 With lnNum+1,止 With 数字-1
EndIf
lnNum=数字
EndScan
Browse For Not Empty(起)
Clear all
Erase test_order_A.Dbf