; Give user the opportunity to choose his own hotkey
Gui, Add, Hotkey, x21 y234 w240 h30 vPanicKey gRunPanicKey,^F12
global myList := ["foo"]
RunPanicKey:
if(PanicKey != "") { ; Make sure the hotkey chosen by the user isn't empty.
myList.Insert("bar") ; Insert new string into the array.
myList2 := myList[2] ; Get 2nd index value and store it in myList2
MsgBox,0,My Array, The 2nd value of myList is: %myList2%
}
return
It appears that myList.Insert() does not work here, because the script cannot find the array, therefore myList2 is empty. But how come? I thought I made the array global?
gui show). every time I enter a key, a msgbox correctly saysthe 2nd value is bar, because that's what's being assigned - phil294The 2nd value of myList is:.. - Dean