Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do i get the name of the variable or array
Message
From
16/12/2006 09:56:42
 
 
To
16/12/2006 09:19:13
Suhas Hegde
Dental Surgeon
Sirsi, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01178248
Message ID:
01178276
Views:
17
--snip--
>What i really intend to do is pass the parameters to a method where the value of the parameter is stored and also the name of the parameter in the form property.
>
>that way I can just use the parameter name to display in the Treeview
>
>Eg:
>
>3 variables are changed from a function
>
>say
>
>MA
>ROC
>RSI
>
>I can just use the variable name to display in the treeview directly rather than specifying the like
>
>If type('MA') != 'L'
>thisform.property[1] = 'MA'
>thisform.property[2] = MA
>endif
>
>
>I want to something like that
>
>Hope i am clear because I am confused too.
>suhashegde

I don't quite understand exactly what you want to accomplish, but anyway I suggest you forget about variables, and use an object to hold your values instead. I will give you a quick briefing of the idea.
public ox && Not necessary, depends on your design
ox=CreateObject('empty') && ox will be your storage object for all your values
AddProperty(ox,'ma',5) && creates a property ox.ma and makes it 5, so ox.ma=5
AddProperty(ox,'foo(5)',4) && creates array ox.foo with five elements, all elements are 4
ox.foo(3)=3 && element ox.foo(3) is changed into 3
To use these object values, you can use a lot of VFP functions and commands, for instance amember() and For each .. Endfor.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform