Jump to content

Assign Dynamic Variables


icarrion
 Share

Recommended Posts

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 by icarrion
Link to comment
Share on other sites

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 by Manadar
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...