以下是引用mywisdom88在2021-4-1 12:58:55的发言:
我的晕死,190秒
我的晕死,190秒
是不是水土不服
两台电脑的配置那个好
IF NOT USED('sp') THEN USE "C:\sp.dbf" IN 0 EXCLUSIVE && 改成你的路径 ENDIF LOCAL icnt as Integer ,ii as Integer LOCAL ckey as String ,str1 as String LOCAL time11 as Datetime ,time22 as Datetime IF USED('result1') THEN USE IN result1 ENDIF LOCAL oDic As Object oDic = CreateObject("Scripting.Dictionary") time11 = SECONDS() SELECT sp GO TOP SCAN str1 = ALLTRIM(sp.jmss1) icnt = ALINES(arr2,str1,1,",") FOR ii =1 TO icnt ckey = LTRIM(STR(ii)) - "_" - arr2(ii) IF odic.Exists(ckey) THEN odic.Item(ckey) = odic.Item(ckey) + 1 ELSE odic.Add( ckey,1) && ENDIF ENDFOR ENDSCAN DIMENSION arrKey(1) as String arrKey =odic.Keys CREATE CURSOR result1 (第几题 c(4) , 分值 c(4),次数 i ) FOR ii = 1 TO odic.Count && *!* tmp11 = LEFT(arrKey(ii), AT('_',arrKey(ii)) -1) *!* tmp22 = SUBSTR(arrKey(ii), AT('_',arrKey(ii)) +1) *!* tmp33 = odic.Item(arrKey(ii)) INSERT INTO result1 (第几题 , 分值 ,次数 ) ; VALUES ( LEFT(arrKey(ii), AT('_',arrKey(ii)) -1), ; SUBSTR(arrKey(ii), AT('_',arrKey(ii)) +1), ; odic.Item(arrKey(ii)) ) ENDFOR time22 = SECONDS() odic.RemoveAll RELEASE oDic SELECT result1 INDEX on 第几题 + 分值 TO 'C:\ind12' && 改成你的路径 BROWSE TITLE "总耗时" + LTRIM(STR(time22 - time11 ,14,4 ))