I believed pointers would be usefull to increase execution speed. Then I found the following:
Ex. 1:
a$="ABCD"
b$="AABCDEFGHIJKLMNOPQ..... (etc)" <- a long (1 Mb) string
j%=instr(a$,b$)
Ex. 2:
a$="ABCD"
b$="AABCDEFGHIJKLMNOPQ..... (etc)" <- a long (1 Mb) string
c = strptr(a$)
j%=instr(@c,b$)
ex.1 and ex.2 should do the same (in fact, they do). But ex. 2 is about 10 times as slow as ex. 1.
Any ideas ?
Ex. 1:
a$="ABCD"
b$="AABCDEFGHIJKLMNOPQ..... (etc)" <- a long (1 Mb) string
j%=instr(a$,b$)
Ex. 2:
a$="ABCD"
b$="AABCDEFGHIJKLMNOPQ..... (etc)" <- a long (1 Mb) string
c = strptr(a$)
j%=instr(@c,b$)
ex.1 and ex.2 should do the same (in fact, they do). But ex. 2 is about 10 times as slow as ex. 1.
Any ideas ?
Comment