Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table name in a variable syntax issue
Message
De
19/09/2012 07:43:01
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
18/09/2012 14:09:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01553159
Message ID:
01553199
Vues:
64
>>>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform