Nojj
Computer
- Apr 8, 2003
- 10
Hi Guys. This one is driving me mad. I'm trying to write a function which receives a user-defined type member name (not its value). How do you pass the name of a type member to a function? Obviously you can pass it as a string but then how do you use it?
This should make things clear:
Private Type MyType
x1 as integer
x2 as single
End type
Dim MyData as MyType
.
.
x = MyFunction(MyData.x2) ' this passes the value (which is not what I want)
MyFunction must be able to do his :
Public Function MyFunction (whatever)
whatever = 1.23 ' save value in MyData.x2
.
.
This should make things clear:
Private Type MyType
x1 as integer
x2 as single
End type
Dim MyData as MyType
.
.
x = MyFunction(MyData.x2) ' this passes the value (which is not what I want)
MyFunction must be able to do his :
Public Function MyFunction (whatever)
whatever = 1.23 ' save value in MyData.x2
.
.