zombieZero
Technical User
I'm new to the Java world, and previously worked with Tcl...in TCL, there is a command called 'subst' which basically allowed for this:
proc setInfo {param val} {
set $param $val
return "Param $param was set to [subst $$param]"
}
setInfo name Bob
Param name was set to Bob.
Basically, I pass the method the name of the variable I want to change, along with the value to change it to. The method then sets the variable internally.
...I want to do the same thing in Java, and I have a feeling the answer is in front of my face but I'm not seeing it. Can anyone steer me in the right direction?
Thanks!
proc setInfo {param val} {
set $param $val
return "Param $param was set to [subst $$param]"
}
setInfo name Bob
Param name was set to Bob.
Basically, I pass the method the name of the variable I want to change, along with the value to change it to. The method then sets the variable internally.
...I want to do the same thing in Java, and I have a feeling the answer is in front of my face but I'm not seeing it. Can anyone steer me in the right direction?
Thanks!