>
> local allhandles = win.handlelist("*",0)
> local v = vec.createfromwords(allhandles)
> v.sort
> local test = v[0]
> local i = v.binsearch(test)
> win.debug(i,v[0]) //i should return 1 ! (instead i get -1)
The issue is the vec is not consistent in its treatment of strings
versus numbers. vec.sort will compare 222 and 1111 as numbers, so
222<1111, but vec.binsearch will compare as strings, so "222">"1111".
I don't want to change the behaviour of vec.binsearch, so you have to
choices:
1. use v.sortstring
2. Download
http://powerpro.webeddie.com/download/vec.dll
and use v.binsearch(target, 2)
where the 2 says to do comparisons like v.sort.