icarrion Posted September 8, 2006 Posted September 8, 2006 (edited) I would like to be able to dynamically assign a variable name like so: array1 = StringSplit("Var1 Value"," ") So that "Var1" is a variable name that contains the data "Value". So that I can do the following: If $var1 = "value" Then blah EndIf Is this at all possible? I know I can do the below instead but it makes the code ugly IMO. array1 = StringSplit("Var1 Value"," ") If $array1[1] = "value" Then blah EndIf Any suggestions? Edited September 8, 2006 by icarrion
jvanegmond Posted September 8, 2006 Posted September 8, 2006 (edited) Yes. Use the function Assign(). I'm sure it is in the Beta helpfile but i don't know about the release version. Assign() in the helpfile can also link you to other functions that things like designating variables from strings. Edit: Execute may also be a good function to look up. Edited September 8, 2006 by Manadar github.com/jvanegmond
dabus Posted September 8, 2006 Posted September 8, 2006 (edited) What about assign? (Damn, I'm too late ) Or you could put your code into an own function, so your script isn't bloated. Edited September 8, 2006 by dabus
icarrion Posted September 8, 2006 Author Posted September 8, 2006 Yes. Use the function Assign(). I'm sure it is in the Beta helpfile but i don't know about the release version. Assign() in the helpfile can also link you to other functions that things like designating variables from strings.Edit: Execute may also be a good function to look up.Thanks guys!!!!!!!!!!!!
GaryFrost Posted September 8, 2006 Posted September 8, 2006 Yes. Use the function Assign(). I'm sure it is in the Beta helpfile but i don't know about the release version. Assign() in the helpfile can also link you to other functions that things like designating variables from strings.Edit: Execute may also be a good function to look up.At this point and time pretty much everything that is in beta is in the latest release. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
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