Thanks again, Sergey.
>
>Thanks, Sergey.
>>
>>I've read in several places that macro substitution should be avoided when possible. Parentheses are used in so many different ways in VFP, and I've never come across a clear explanation of all of their uses. >
>This particular use of parentheses is called Name Expession. You can find it in the help under Name Expession creating. You can use it anywhere VFP command or function requires that you supply a name. For Example,
lcFrom = "Myfile.txt"
>lcTo = "Newfile.txt"
>COPY FILE (lcFrom) TO (lcTo)
>However, it does surprise me that a function call like EVAL() would be significantly faster than a macro.>
>The macro substitution is slow because Foxpro has to parse it at runtime to find out what it represents. When you use EVAL() or Name Expression Foxpro knows what to do w/o additional processing.
>
>
>Does DO CASE add speed also, or just a sort of logical readability? >
>Both.
>
>
>Doesn't the engine have to evaluate the entire DO CASE structure when it encounters it, whereas it need only look at the first line of each IF statement?>
>No, only the CASE conditions're evaluated until found one that evaluates to True. The rest of the conditions are not checked. You can speed up DO CASE by moving conditions that most likely to evaluates to True to the top of the structure.
>
>
>< snip >