Jump to content

Recommended Posts

Posted

How do we declare a map with values as a constant?

Do we have to create a non-constant map, add values and then copy it to a constant variable?

Local $_temp[]
$_temp["foo"] = "bar"
Local Const $TEST = $_temp
Posted (edited)

There is not any initializer for map variables so there is no way to declare and initialize directly constant maps. Your example above is what you can do instead.

Edit: there is a ticket where someone proposed a way to initialize maps but I don't think it will be done soon, at least not as it was proposed.

https://www.autoitscript.com/trac/autoit/ticket/3969

Edited by Andreik

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
×
×
  • Create New...