General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only