Jump to content

Dynamic Variables


Recommended Posts

1st time appender!

I've used Autoit numerous times and it's a good language. I have a situation where I want to dynamically create a variable with a name equal to the value of some other fixed name variable. For example if $var1 = "bob", then I want to create a variable named "bob". Since the fixed variable can have any value, the newly created variable name is dynamic. I've done this in a few other langauges especially when I'm processing large ini files. I read a key/value set from an INI and then create a variable with the key "name" equal to the key "value".

Can anything like this be done in Autoit??

Thanks

BobH

Link to comment
Share on other sites

On the surface, it looks like "Assign" will do what I'm looking for. I scanned the help numerous time and missed it. Thanks.

I'm not using inireadsection because it would create the array elements in the order they exist in the ini file. In my case I cannot assume the keys are always in the same order. Creating variables from the keys means I can just check the value of the variable regardless of the its order in the section.

Thanks again for the quick responses

BobH

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