Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing file variables to a function
Message
De
15/04/1999 13:50:44
 
 
À
15/04/1999 13:39:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00208655
Message ID:
00208669
Vues:
23
Hi Henry ---

>When I then attempt to access the member variable record_field_name for the name of the record field in say a SCATTER command (i.e. SCATTER THIS.record_field_name ... TO laFieldInfo) I get an error like the following "RECORD_FIELD_NAME is not a file variable".

Try the following:

cRecord_Field_Name = THIS.record_field_name
SCATTER (cRecord_field_name) TO laFieldInfo.

The problem is that SCATTER (and lots of other commands) expect a literal, not a string as the fieldname. It is trying to interpret THIS.whatever as table THIS, field whatever. So you have to move this into a variable (to get rid of the ".") and then put the parenthesis around it to have the variable evaluated and not taken literally.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform