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
17/12/2006 00:54:30
Suhas Hegde
Dental Surgeon
Sirsi, India
 
 
To
16/12/2006 09:56:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01178248
Message ID:
01178366
Views:
15
>--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.


hi,
I am in a fix. I want to forget the variables part and it becomes easy. OTOH the FLL I have written takes parameters as reference and if it was a part of the object it doesnt take it

Eg:

MYfunction(@thisform.abc,@thisform.array1) && myfunction is a fll function and it wount take object referenced variables or array

m.abc = thisform.abc
acopy(thisform.array1,aarray1)
MYfunction(@abc,@aaray1) && works ...

so Thats the problem ...
may be i will have to go with the if type('')!='L' way

suhashegde
Previous
Reply
Map
View

Click here to load this message in the networking platform