Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL, Views, and Macro Substitution
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00921296
Message ID:
00921630
Views:
28
Hi Paul,

I had a view that I was using macro substitution with, and this is what I did:

VFP8:
WHERE &lcCond ; && lcCond is either 'EMPTY(...)', 'NOT EMPTY(...)', or '.T.'.

VFP9:
WHERE ICASE(?lcFilledCond=1,NOT EMPTY(Shift.Emp_id),?lcFilledCond=2,EMPTY(Shift.Emp_id),?lcFilledCond=3, .T.);


>I may have figured this one out! VFP9.0 (beta) does not allow macro-substitution in a View definition using the (&) ampersand.
>
>Using paranthesis () for macro-substitution doesn't work either because the View Designer uses them to seperate values.
>
>I think I got around the problem by using the Evaluate() function.
>
>I will test it and also try to see if having this "function" in the where clause will cause a significant slow down.
>
>BROKEN CODE:
> select * from ji!wo where &vcWhere
>
>FIXED CODE:
> select * from ji!wo where evaluate(vcWhere)
>
>*Note - When using "&vcWhere" in previous version of VFP, you did NOT want vcWhere to be defined. When using the "evaluate(vcWhere)", vcWhere MUST be defined to avoid an error.
>
>Thanks,
>Paul
Mike C.
-------
I keep trying to find a life of my own, apart from you.
DC Talk/Charlie Peacock, In the Light.
www.risensystems.com/ra/itlbegin.rm
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform