Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro substitution syntax

Status
Not open for further replies.

bsutton55

Programmer
Feb 4, 2014
12
GB
I am struggling with some macro substitution syntax.
I have a label which has the following property "cfilter" set to "SET FILTER TO MYTABLE.ACCEPTED" where the ACCEPTED field is Logical.

The code in the doubleclick event is

&this.cfilter

I am getting unrecognised command verb.

What am I doing wrong?
Thanks
Barry Sutton.


 
In short: You can't use a property for macro substitution. The macro has to be in a string variable, nothing else works. With your code VFP would expect a variable named "this", which doesn't and can't exist, but only variables are used for substution. So do it this way:

Code:
Local lcMacro
lcMacro = This.cFilter
&lcMacro.

Bye, Olaf.
 
The label contains that (cfilter) property? Or is it the caption?
If it's the label itself, in the doubleclick event you could do something like:
Code:
STORE STRTRAN(This.cfilter, "SET FILTER TO", "") TO  cFilter
SET FILTER TO &cFilter
If it's the caption, use instead:
Code:
STORE STRTRAN(This.Caption, "SET FILTER TO", "") TO cFilter
SET FILTER TO &cFilter

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top