Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Evaluate()????
Message
De
14/09/1998 11:31:41
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00136188
Message ID:
00136223
Vues:
31
>>>Hi all,
>>>
>>>I'm trying to use a generic statement to get the value of a specific field in a record by using evaluate(). Each time I try it I get a syntax error. Here's the code I'm using, any ideas??
>>>
>>>lcField = 'MyTable.'+field(lnCnt)
>>>
>>>lnATAFValue = eval(lcField)
>>>
>>>TIA
>>
>>Hi Perry,
>>
>>Your code looks OK. Are you sure that lnCnt hasn't got too big, or maybe you start from 0 rather than 1? (I guess you're using a loop bounded by FCOUNT(), do you specify FCOUNT( 'MyTable') when starting the loop, otherwise you may get the number of fields from the currently selected table rather than MyTable.
>>
>>p.s. Stick with EVAL as it is much faster when looping than &.
>
>Mark,
>
>When I run it through the debugger, the values for the field names are good. I get errors trying to retrieve the data in that particular field.

So what's the field name that has you stuck? If other fields work OK it seems possible that there is some isue with the name? Also, is this the first or last field in the table?
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform