greenfalcon
Registered User.
- Local time
- Yesterday, 22:05
- Joined
- Aug 22, 2006
- Messages
- 34
I will attempt and keep this short and sweet,
I essentially have a lot of code that is duplicated within a case statement that updates the values of separate variables before performing computations... my question is this, i would like to be able to pass the function the name of a variable and have it update that variable... it would look something like this
Sub test()
tmpResult = updateValues("variable1")
tmpResult = updateValues("variable2")
end sub
Function updateValues(Dim myValue as ??)
myValue = 1 + 2 + unknownFactor
End function
I have made this example really basic, I hope it makes sense, let me know if there are any suggestions.. I know how to refer to an array by name but not strings/integers and such... I just want to pass the name to another variable..
Thanks again
Jason
I essentially have a lot of code that is duplicated within a case statement that updates the values of separate variables before performing computations... my question is this, i would like to be able to pass the function the name of a variable and have it update that variable... it would look something like this
Sub test()
tmpResult = updateValues("variable1")
tmpResult = updateValues("variable2")
end sub
Function updateValues(Dim myValue as ??)
myValue = 1 + 2 + unknownFactor
End function
I have made this example really basic, I hope it makes sense, let me know if there are any suggestions.. I know how to refer to an array by name but not strings/integers and such... I just want to pass the name to another variable..
Thanks again
Jason