Thanks Christof,
You are very informative - as usual!
John
>Hi John,
>
>>Just out of curiosity, have you benchmarked VFP 8 and C++ when finding the number of occurences of Anna in a text file of War and Peace?
>
>No, but I wouldn't expect much of a difference here. The OCCURS() function is written in C++ and can just as quickly scan the text. What slows VFP down is basically:
>
>a) You cannot specify a size for a string but only use part of that allocated memory. Every time you extend a string, VFP needs to allocate new memory.
>
>b) You can't easily access individual characters or substrings. You have to use SUBSTR() and STUFF(). Especiall, STUFF is slow because
>
>c) VFP has no concept of manipulating an existing string. Every string function that manipulates a string returns a new one as a result. Due to the number of string copy operations, manpipulating large strings in VFP is comparable slow.
>
>--
>Christof
John Harvey
Shelbynet.com
"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright