Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object refererence not valid
Message
 
 
To
11/07/2007 12:22:50
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01239356
Message ID:
01239360
Views:
10
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform