Jump to content

Recommended Posts

Posted (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 by icarrion
Posted (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 by Manadar
Posted (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 by dabus
Posted

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!!!!!!!!!!!!

Posted

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.

 

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
  • Recently Browsing   0 members

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