Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro substitution
Message
 
À
16/12/1999 23:21:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00305094
Message ID:
00305110
Vues:
18
>Hi. I am trying to use macro substitution to select a field from the active record of a dbf and put it in a variable to use as a report heading.
>
> Why won't this line of code work:
>codename=codelist.code(xcode).value
>
> I get the message "Object codelist not found"
>
> Where codelist = my dbf
> xcode = an alpha character
> codelist fields = codea, codeb, codec, etc.
> thanks.

Randy,

It doesn't work because the () are a name expression adn can only be used in places wehre VFP expects tha name of something to be. Try code like this;
lcCode = "CodeList.Code" + xCode
codename = &lcCode
Also you can notice that the .Value was dropped in my example, this is because fields don't have a value proeprty, the fiedl name is the vlaue property for the field.

My example is macro substitution, using the &. Your example was a name expression and they won't work in this context.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform