; 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
작동하지 않습니다. 근데 어떻게? 전 배열을 글로벌하게 만들었다 고 생각 했나요? 귀하의 코멘트에서 볼 수 있듯이AutoHotkey를 - 글로벌 배열을 선언 그러므로 <code>myList2</code>이 비어있는, 그것은 스크립트 배열을 찾을 수 없기 때문에 <code>myList.Insert()</code>가 여기에 작동하지 않는 것 같습니다
afaik, AHK에서 변수를 전역 변수로 선언 할 필요가 없습니다. – Blauhirn
도 문제는 이해할 수 없습니다. 나는 당신의 프로그램을 실행했다. ('gui show'를 추가했다.) 매번 키를 입력 할 때마다 msgbox가 정확하게 '두 번째 값은 bar'라고 말합니다. 할당 된 값이기 때문에 – Blauhirn
AutoHotkey 1.1.22.02를 사용하고 있으며 나에게 적합하지 않습니다. 그냥'myList의 두 번째 가치는 : .. .. – Dean