I'm having a headache trying to assign a variable that will reference a member of a user defined type, i.e
i've designed the type thus:
public type Details
A as variant
B as variant
......(so on and so forth)
end type
later in the programme I want to reference particular members of an instance of this type depending on a case statement; my idea is to set a variable that will be set for each Case e.g
case 1
variable = "A"
case 2
variable = "B"
etc
i then try to reference the member like:
if Details.variable = 0 then
....
it doesn't work and throws the error: 'Method or data member not found.' Is there any way you can reference a data member in this manner??
thanks Si but maybe I've made it sound more complicated than it is: all I want is to be able to use a variable that will identify which member of Details i want to get the value of, like say I want Details.A but I'm only going to know at runtime that i want "A" so for different situations I may want "B" or "C" etc, that's why I created the variable in the Case statements.
I would like to be able to reference the members dynamically by saying:
You need a class and a collection to do something like what you want.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
I'm not sure the Class/collection route is need I stil believ my second pice of code is more in tune with what the poster whats.
The attached shows a cleaner version of my previous post.
Sorry, but I think my approach is nicer. You're not using a "variable" to get to the member the user wants, but a select case to show one or other member. I think.... your code does not fit what smydo needs. But this is something he could only answer because your approach might fit perfectly on what he is doing.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.