Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The m. variable thing, the sequel
Message
De
27/01/2005 13:03:40
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
27/01/2005 12:37:21
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Database:
Visual FoxPro
Divers
Thread ID:
00969478
Message ID:
00981292
Vues:
40
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform