Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EVALUATE and macro substitution alternatives
Message
From
28/06/2000 14:21:33
 
 
To
28/06/2000 14:13:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00385373
Message ID:
00385956
Views:
13
>An example of the tricky case:
>lcSearchString = "ATable.cDesiredInfo = 'This one'"
>SCAN FOR &lcSearchString && macro substitution performed once for the SCAN
>ENDSCAN

I would use & for that anyway (and SQL statements like you mentioned) for another reason, so you can do:

lcSearchString = iif(empty(tcSearchString), '', 'FOR ' + tcSearchString)SCAN &lcSearchString
ENDSCAN


Then, VFP never sees the "FOR" (or "WHERE"s ect. on SQL Selects) if the variable condition is empty. And of course Eval() wouldnt' work in that case.
Previous
Reply
Map
View

Click here to load this message in the networking platform