>Hi Aleksey,
>
>I have a little special situation with parameters that I think is outside of the scope of that thread. Instead of:
>
>"field1=?m.param"
>
>I want to say
>
>"m.param" (where m.param is "field1=?m.param")
>
>I don't even know the field that will be queried until run-time. If I could use a macro in .selectcmd, it'd be great1
>
>"SELECT * FROM table1 WHERE &lcwhere"
>
>thanks
>
>bonnie
This is supported, but the macro is replaced the first time only
(at CA.CursorFill time or when the RV is opened);
result: then REQUERY() or CursorRefresh() commands are static.
VFPT ( Aleksey ) can implement this with the syntax
( currently this fire a error, then no backward issues are opened )
"SELECT * FROM table1 &?stringexpression"
with this the CURSORGETPROPERTY("SQL")=="SELECT * FROM table1 &?stringexpression"
and the macro is expanded at execute time ( REQUERY() or CursorRefresh()),
using the evaluated parameter
stringexpression.
This have another important effect,
it allow a very usefull behaviour,
currently unsupported:
support literal parametersExample:
z=1
"SELECT * FROM table WHERE x=&?LTRIM(STR(m.z))"
"SELECT * FROM table WHERE x=1"
Fabio