回复 60楼 sdta
trix的没问题
CLEAR CLOSE TABLES USE 1a0001.DBF ALIAS A T1=seconds() BLANK ALL FIELDS K,D,TRIX,TRMA G=0 nday=9 &&修改天数 FOR I=1 TO RECCOUNT()-(nday-1) SELECT MAX(SHHIGH),MIN(SHLOW) FROM 1A0001 WHERE BETWEEN(RECNO(),I,I+(nday-1)) INTO ARRAY AA SELECT A REPLACE K WITH AA(1,2),D WITH AA(1,1),TRIX WITH (ABS(shclose-k)/ABS(d-k))*100,TRMA WITH (TRIX+2*G)/3 FOR RECNO()=I+(nday-1) GO I+(nday-1) G=TRMA ENDFOR MESSAGEBOX("共用时间: "+TRANSFORM(seconds()-T1,"@Z 999.99")+" 秒") BROWSE修改后的代码
CLOSE TABLES USE 1a0001.DBF ALIAS A T1=seconds() BLANK ALL FIELDS K,D,TRIX,TRMA G=0 H=0 nday=9 &&修改天数 FOR I=1 TO RECCOUNT()-(nday-1) SELECT MAX(SHHIGH),MIN(SHLOW) FROM 1A0001 WHERE BETWEEN(RECNO(),I,I+(nday-1)) INTO ARRAY AA SELECT A REPLACE K WITH AA(1,2),D WITH AA(1,1),TRIX WITH (ABS(shclose-k)/ABS(d-k))*100,TRMA WITH (TRIX+2*G)/3,TRMD WITH (TRMA+2*H)/3 FOR RECNO()=I+(nday-1) GO I+(nday-1) G=TRMA H=TRMD ENDFOR MESSAGEBOX("共用时间: "+TRANSFORM(seconds()-T1,"@Z 999.99")+" 秒") BROWSE