magaf Posted August 24, 2004 Posted August 24, 2004 (edited) is that possible ? example $x = abc $($x) = def so the var $abc contains def Edited August 24, 2004 by magaf
this-is-me Posted August 24, 2004 Posted August 24, 2004 If you mean does $var = "$var" or $var = "var" work, then the answer is yes. Who else would I be?
trids Posted August 24, 2004 Posted August 24, 2004 See if the function Eval() in the helpfile answers your question
CyberSlug Posted August 24, 2004 Posted August 24, 2004 You will probably also need the Assign function in the newest unstable version of AutoIt$x = "abc" Assign("abc", "def") MsgBox(4096, "One...", $abc) MsgBox(4096, "Two...", Eval("abc")) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
magaf Posted August 24, 2004 Author Posted August 24, 2004 thanks for responding through im yet to find a solution for what i ment, the variable content is unknown (the reason i want to make variable (ehich will refer to its content) as a variable's name) so i cant use assign
jhocott Posted August 24, 2004 Posted August 24, 2004 Many thanks for this dialogue. Eval satisfies my need for indirection. Coincidentally, I was searching for the same thing. Jay
magaf Posted August 24, 2004 Author Posted August 24, 2004 thanks , that solved it. btw can i do this with arrays also? (array's name would be a variavle's content (thats basicly what i wanted to achieve))
magaf Posted August 24, 2004 Author Posted August 24, 2004 how and how could i work with an enviorment variable after?
magaf Posted August 25, 2004 Author Posted August 25, 2004 can i make envierment variable arrays and if not what other is there other way to do variable as a variable's name or cant it be done yet with autoit?
SlimShady Posted August 25, 2004 Posted August 25, 2004 (edited) variable as a variable's name <{POST_SNAPBACK}>$x = "abc" Assign($x, $x) MsgBox(0, "", Eval($x)) As Cyberslug, you need the latest unstable version to make it work. Available below. http://www.autoitscript.com/autoit3/files/unstable/autoit/ Edit 1: Made a good example. Edit 2: I just checked your first post... Here's the working version of your example. $x = "abc" Assign($x, "def") var $abc contains "def" (without quotes) Edited August 25, 2004 by SlimShady
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now