I'm not sure if the bug exists in AHK v1.1. Negative StartingPos for InStr:
Code: Select all
msgbox(InStr("4111.3",".",,-1)) ;says [b]5[/b] instead of [b]2[/b]
;If StartingPos is negative, the search is conducted in reverse (right-to-left),
; starting at that position from the right. For example, -1 starts at the last character.
; If StartingPos is 0 or beyond the length of Haystack, 0 is returned.
The bug might be related to Windows though (tested with Win7 x64 SP1). I have a scene with 2 ListView GUI controls.
Everything works as expected until I try to assign a custom background for ListView: lv.Opt(backgroundNNN).
After that the old ListView focus position is not redrawn with custom background automatically until the time the old ListView rebuilt (lv.Delete(), lv.Insert(,,,,))
screenshot: Old ListView focus position with default background instead of set one (grey).
simplified code snippet:
Code: Select all
g:=GuiCreate()
n:=15
f:=g.Add("ListView","w450 r" n " backgroundgray", "C1|C2|C3|C4|C5")
loop(n)
i:=A_Index, f.Insert(i,,"", "val " i, "val " i, "val " i, "val " i, "val " i)
f:=g.Add("ListView","w450 r" n " backgroundgray", "C1|C2|C3|C4|C5")
Loop(n)
i:=A_Index, f.Insert(i,,"", "val " i, "val " i, "val " i, "val " i, "val " i)
g.OnEvent("Close", () => ExitApp()), g.OnEvent("Escape", () => ExitApp())
g.Show()
screenshot: and in my ahk v2 script it goes even further showing 2 focused (in blue) lines in 2 LVs (old and select one) with lv.Modify(row, "Select") (not as expected).
Moderator Note: Moved from AutoHotkey v2 Development forum. ~ sinkfaze