Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why cannot use & with Thisform.SomeProperty
Message
 
 
À
04/05/2009 21:20:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01397844
Message ID:
01397945
Vues:
109
>>>Does not work:
>>>
>>>
>
>>>seek &Thisform.cSeekValueRef
>>>
>
>>>
>>>Does work:
>>>
>>>
>
>>>lcSeekValueRef=Thisform.cSeekValueRef
>>>seek &lcSeekValueRef
>>>
>
>>>
>>>Am I correct? Why is it this way?
>
>>Just to answer the general question, you can only macro-expand variables, not fields or properties.
>
>I have used macro substitution with table.fields -->
>
>lcAlias = ALIAS()
>
>REPLACE &lcAlias..fieldname WITH lcValue
>
>The key here is that you have to use two periods (..) -- the first ends the macro substitution, the second separates the field name. I have used this for passing a table reference to a UDF where the table alias may be different/unknown at runtime (generic UDF).

Greg,

Sorry to disappoint you, but in your case you should have been using name expression instead.

E.g.

replace (lcFiledName) with lcValue in (lcAlias) && this is much better and safer syntax
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform