Kane Jeeves
Active member
- Joined
- May 17, 2006
- Messages
- 44
- Programming Experience
- 5-10
Is there a way to access members of a structure without knowing the member name? E.g.: (pseudo code of course)
Structure MyStr
dim Mem1 as string
dim Mem2 as string
...
dim Mem75 as string
End Structure
dim astruct as New MyStr...
'populate astruct from 75 form fields...
'now get all the values
for i = 1 to 75
astruct.Getvalue("Mem" & cstr(i))
next i
INSTEAD OF...
x = astruct.Mem1
y = astruct.Mem2
...
zzz = astruct.Mem75
I don't want to just slam the structure into an array because I might need to do some special processing on individual fields, but I also don't want to hand code getting the values of 75 fields (I have 3 other forms with 50-100 fields).
Any help is appreciated!
- Kane
Structure MyStr
dim Mem1 as string
dim Mem2 as string
...
dim Mem75 as string
End Structure
dim astruct as New MyStr...
'populate astruct from 75 form fields...
'now get all the values
for i = 1 to 75
astruct.Getvalue("Mem" & cstr(i))
next i
INSTEAD OF...
x = astruct.Mem1
y = astruct.Mem2
...
zzz = astruct.Mem75
I don't want to just slam the structure into an array because I might need to do some special processing on individual fields, but I also don't want to hand code getting the values of 75 fields (I have 3 other forms with 50-100 fields).
Any help is appreciated!
- Kane