Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object refererence not valid
Message
 
 
À
11/07/2007 12:22:50
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01239356
Message ID:
01239360
Vues:
8
>The value of ('loObj'+LTRIM(STR(m.jx+1))) is "loObj1" and I know that loObj1.FieldCount is numeric. Why do I get an error that the expression is not numeric? I assume it's really .F. as it's not a valid expression, but why? Thanks!
>
>
>FOR iCount = 1 TO ('loObj'+LTRIM(STR(m.jx+1))).FieldCount
>
You can not use name expression to get a value, you need to use EVALUATE in your case:
with evaluate('loObj'+LTRIM(STR(m.jx+1))
   for iCount = 1 to .FieldCount
     ...
endwith
You can also use
lnFields = GetPem('loObj'+LTRIM(STR(m.jx+1)), 'FieldCount')
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform