Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The m. variable thing, the sequel
Message
From
27/01/2005 13:03:40
 
 
To
27/01/2005 12:37:21
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00969478
Message ID:
00981292
Views:
41
Hi, Gary-

>I must have missed the real question here.

The difference is subtle. It's not whether the variable's value has a period, but whether the variable's literal has one.

>I put:
>x=[messagebox(thisform.caption)]
>&x
>
>x='thisform.caption'
>messagebox(&x)
In your example, The string "x" has been evaluated (no period in "x") and resulted in a perfectly legitimate command.
messagebox(thisform.caption)
>
>Isn't this what we're talking about? I must have misunderstood the issue.

Let me give you an example, and hopefully, that'll help explain the difference. Let's say I have a form that builds a Select statement that I'll run before printing a report. So, I have a custom property called SelectCmd. Something like:
ThisForm.SelectCmd = "Select * from Customers"
I can't do the following:
&thisform.SelectCmd.
Or any other variation. Since the "." terminates the macro expression, FoxPro would try to find a string variable called ThisForm, but that's of course not available. So, I have to do this:
lcCmd = thisform.SelectCmd
&lcCmd. && Don't need the period in this case, but just making the point. No pun intended.
The issue of prefixing literals with "m." is the same thing.
Local lcSelectCmd
lcSelectCmd = "Select * from Customers"
&m.SelectCmd. && Will look for a string variable "m"
&lcSelectCmd. && Is okay.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform