Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
27/12/2002 08:17:58
 
 
To
27/12/2002 07:49:27
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00735756
Message ID:
00736019
Views:
25
>>There are more than enough situations where speed isn't an issue at all, for example if it's not in a million times loop. Even in a SQL-query it's okay, as the substitution is done only once by vfp.
>
>I remember a case - but I don't remember the exact details - where macro substitution turned out to be much faster. I think it was within a complex SQL - SELECT statement, where (my interpretation of the results) macro substitution had to be performed only once, whereas eval() was performed on each and every record.

Very good example! And very relevant also!

>The idea, of course, is to have a single SELECT command for (say) three alternative sort orders, and four different filter conditions, based on user criteria.
>
>I find this particular case very difficult to program without macro substitution. And, of course, the macro substitution is easier to read (and maintain!) than two nested DO CASE statements, with a total of 12 SELECT statements...

You're talking here about, what I call, a parametrized SQL-query. Again.. very good example. Again.. very relevant also.

>Hilmar.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform