Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause in vfp8
Message
From
23/04/2003 03:31:38
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00774269
Message ID:
00780493
Views:
54
George,

>>>The statement is interpreted once and called multiple times in a FOR...NEXT iteration structure. There's no question about it.
>>
>>Not true, it's compiled once, interpretated and executed for each loop. That's the nature of P-code compile languages
>>
>Walter,

>Yeah right! Before building applications, I wanted to do systems. I did quite a bit of studying, both formally and informally. What you're saying is this: The MAX() function executes once, scanning the entire table and returns the maximum value. Even if that were true, you don't eliminate the number of comparisons required.

No, I did not say this. Read carefully. The statement in a FOR NEXT loop is interpreated and executed multiple times, while the MAX() function is interpretated onces (as a part of the SQL SELECT statement) and executed internally for each row. On what level it is executed I do not know because it is not documented.

Now of course I do not know the internals of VFP, but the interpreation process at the least reads the P-code instruction again, sets a few variables (like the last linenumber), checks various settings (e.g. for the coverage profiler, the keyboard buffer, maybe other windows messages) etc. The SQL statement is a statement that is interpretated as a whole where certain parts which contains functions and other non optimizable expressions are evaluated when neccesarry. Also do remember that MAX(), MIN(), CNT() used in a SQL Statement are not normal VFP instructions as they only operate this way in the SQL statement. Their function might be totally different from normal VFP commands.

>Further, any language developer will tell you that the difference between constants and variables is of no import. There's no difference between calling a function with a constant and calling the same function with a variable. Each iteration requires that the parameters be placed on the stack and passed to the function.

I don´t deny this.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform