Code: Select all
For Index, Value in A_Args
{
If (Value = "asdf")
{
Global asdf := 1
}
If (Value = "jkl")
{
Global jkl := 1
}
If (Value = "abcd")
{
Global abcd := 1
}
}
Code: Select all
For Index, Value in A_Args
{
If (Value = "asdf")
{
Global asdf := 1
}
If (Value = "jkl")
{
Global jkl := 1
}
If (Value = "abcd")
{
Global abcd := 1
}
}
Prevents you from doingAlso note that it is not currently possible to declare a dynamic variable such as global Array%i%.
Code: Select all
For Index, Value in A_Args
Global %Value%:=1
Code: Select all
For Index, Value in A_Args {
If (Value="asdf")
Global asdf:=1
Else If (Value="jkl")
Global jkl:=1
Else If (Value="abcd")
Global abcd:=1
}
Agreed.
Code: Select all
Global Settings:={}
A_Args:=["asdf","jkl","abcd"] ; Just for this example
For Index, Value in A_Args
Settings[Value]:=1
MsgBox % Settings.jkl ; Test one to see that it was set to 1
I think this is exactly what I'm looking for. Thanks.Sam_ wrote: ↑08 Jan 2020, 12:58Agreed.Code: Select all
Global Settings:={} A_Args:=["asdf","jkl","abcd"] ; Just for this example For Index, Value in A_Args Settings[Value]:=1 MsgBox % Settings.jkl ; Test one to see that it was set to 1