Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting field value by using the Alias
Message
From
08/11/2001 17:35:33
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00579179
Message ID:
00579425
Views:
30
>Everybody,
>
>I have created a class that has a custom property called "cAliasName". This property represents the alias for a temporary table. In this table, I have a field called "periods". How do I get value of the "Periods" field.
>
>For example the value in the "Periods" field is 12 and I want the varable lnPeriods to equal 12.
>
>I have tried the following and several other but continue to get errors.
>lnPeriods = Eval(This.cAliasName)->Periods
>lnPeriods = &This.cAliasName->Periods
>lnPeriods = (This.cAliasName)->Periods

What others have told you should work, unless you got trailing spaces in cAlias name. To avoid this:

lnPeriods=evaluate(forceext(this.cAliasName, alltrim("Periods")))

Forceext() function keeps the trailing or leading blanks in the extension, that's why I trimmed it. If you're running VFP before 6, load FoxTools first.

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