a few bugs?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
vvhitevvizard
Posts: 454
Joined: 25 Nov 2018, 10:15
Location: Russia

a few bugs?

06 Dec 2018, 12:39

bug 1
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.
bug 2
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(,,,,))
Image
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()

Image
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). :D

Moderator Note: Moved from AutoHotkey v2 Development forum. ~ sinkfaze
Last edited by vvhitevvizard on 06 Dec 2018, 13:40, edited 28 times in total.
just me
Posts: 9453
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: a few bugs

06 Dec 2018, 12:43

bug 1
The missing link:
Regardless of the value of StartingPos, the return value is always relative to the first character of Haystack. For example, the position of "abc" in "123abc789" is always 4.
User avatar
vvhitevvizard
Posts: 454
Joined: 25 Nov 2018, 10:15
Location: Russia

Re: a few bugs

06 Dec 2018, 12:44

just me wrote:
06 Dec 2018, 12:43
Regardless of the value of StartingPos, the return value is always relative to the first character of Haystack. For example, the position of "abc" in "123abc789" is always 4.
Ah I see. :D Thank u for quick reply!

I updated 1st post with the snippet and new screenshot. Old ListView focus position is redrawn with default background instead of set one.
Last edited by vvhitevvizard on 06 Dec 2018, 13:27, edited 1 time in total.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: a few bugs

06 Dec 2018, 21:47

nice. making a bitcoin trading bot?

User avatar
sinkfaze
Posts: 616
Joined: 01 Oct 2013, 08:01

Re: a few bugs?

07 Dec 2018, 09:58

I have moved this from the v2 forums until we can verify that the functionality in question are actually bugs.
User avatar
vvhitevvizard
Posts: 454
Joined: 25 Nov 2018, 10:15
Location: Russia

Re: a few bugs

10 Dec 2018, 13:39

guest3456 wrote:
06 Dec 2018, 21:47
nice. making a bitcoin trading bot?
not a bot. trade tool. sort of. ;)

btw the issue (bug or feature?) with AHK being no respecter of the custom background continues with custom foreground colors as well.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 169 guests