Hi everybody, here are some tips sharing. So lets try to post our most frequnce use tips here. I think this kinda tips is very useful for beginer like me:
USE EVALUATE OR () instread of & (MACRO ASSIGN)
*Conclusion EVALUATE is faster
USE INSERT instead of APPEND BLANK follow by REPLACE or GATHER MEMVAR
*Conclusion INSERT is faster.
Just copy code above test run.
USE EVALUATE OR () instread of & (MACRO ASSIGN)
Code:
CREATE CURSOR t (cText C(3),nNumeric N(4),cText2 C(3))
INSERT INTO T (cText,nNumeric,cText2) VALUES ("456",9,"789")
CLEAR
X="T"
L_SEC = SECONDS()
FOR i=1 TO 10
??&X..ctext
ENDFOR
?SECONDS()-L_SEC
?""
L_SEN = SECONDS()
FOR I=1 TO 10
??EVALUATE(X+".CTEXT")
ENDFOR
?SECONDS()-L_SEN
USE INSERT instead of APPEND BLANK follow by REPLACE or GATHER MEMVAR
Code:
CREATE CURSOR t (cText C(3),nNumeric N(4),cText2 C(3))
INSERT INTO T (cText,nNumeric,cText2) VALUES ("456",9,"789")
SCATTER MEMVAR
CLEAR
X="T"
L_SEC = SECONDS()
FOR i=1 TO 10
APPEND BLANK
GATHER MEMVAR
ENDFOR
?"APPEND BLANK, FOLLOW BY REPLACE"
?SECONDS()-L_SEC
?""
L_SEN = SECONDS()
FOR I=1 TO 10
INSERT INTO t FROM MEMVAR
ENDFOR
?"INSERT INTO"
?SECONDS()-L_SEN
Just copy code above test run.