Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field name != variable name?
Message
From
26/05/1998 16:26:20
 
 
To
21/05/1998 01:59:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00100420
Message ID:
00102101
Views:
27
>Hi Michelle,
>It's normal behaviour in FP (all versions AFAIK). If the same variable name exist in the table that's open in current workarea then table fieldname takes precedence. To avoid it you must alias the memvar with "m.".
* Some tests here
>* Table mytable has fields clname and cfname
>clname = "aaaaaa"
>cfname = "bbbbbb"
>use mytable
>select 0    && Change workarea
>? clname,cfname    && Prints "aaa.." and "bb.."
>select mytable
>? clname,cfname    && Prints field values
>? m.clname,m.cfname    && Prints "aaa.." and "bb.."
Cetin


Sigh. Everyone seems to be missing the point. Or does it seem to be such an obvous question that no one is actually reading what I'm saying?

The variable name and the field name are _NOT_ the same. If it was, this would be a no brainer. One is "lname" and one is "clname".

Sorry if I sound cross. I'm just getting a bit frustrated.

Thanks,
Previous
Reply
Map
View

Click here to load this message in the networking platform