Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table name in a variable syntax issue
Message
From
19/09/2012 07:43:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/09/2012 14:09:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01553159
Message ID:
01553199
Views:
65
>>>I have a need to access some tables using:
>>>
>>>USE (m.TableTo Use) IN 1
>>>
>>>I am trying refer to a field in the table this way:
>>>
>>>Variable = (m.TableToUse).fieldname  && Is not working for me.
>>>Variable = (m.TableToUse.fieldname)  && Is also not working for me.
>>>
>>>How is it done, please?
>>
>>
Variable = eval(m.TableToUse + ".fieldname")
Unless your TableToUse begins with a digit, contains spaces or some other nasty things which are allowed in filenames but not in variables. Then Fox will adorn it with W1 for an alias (or Wn, where n is the workarea in the current DS).

Instead, I'd propose something simpler:
USE (m.TableTo Use) IN 1 alias ttu
variable=ttu.fieldname
(which I wrote when I thought I read the whole thread... well, I did, just not exactly whole)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform