I have a script file about 2000 lines big + several include files. It basically works, but sporadically I get a strange error message when a specific controlget is executed. The error always occurs at exactly the same place (but most of the time, there is no error when executing these lines):
Code: Select all
---------------------------
saff.ahk
---------------------------
Critical Error in #include file "c:\bat\Help.ahk":
Invalid memory read/write.
Line#
183: Sleep,200
184: }
186: {
187: ControlGetFocus,cntrl,A
188: debug("#NoFocus", "Focused control: " cntrl)
190: if (cntrl) && (cntrl<>"TPSSynEdit1")
190: {
---> 191: ControlGet,Result,Selected,,%cntrl%,A
192: t := "CtrlGet"
193: }
195: Else
195: {
196: clpSaveAndSet()
197: Send,^c
198: Result := clpGetAndRestore()
The program is now unstable and will exit.
---------------------------
OK
---------------------------
i have no idea how to debug this, I have checked that according to my debugging output (line 188), the variable cntrl contains the correct data.