icarrion Posted September 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
jvanegmond Posted September 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
dabus Posted September 8, 2006 Share 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 Link to comment Share on other sites More sharing options...
icarrion Posted September 8, 2006 Author Share 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!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
GaryFrost Posted September 8, 2006 Share 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. Link to comment Share on other sites More sharing options...
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