--- In [email protected], "brucexs" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "aviasd" <aviasd@> wrote:
> >
> > --- In [email protected], "aviasd" <aviasd@> wrote:
> >
> > Forgot to mention that i do a vec.sort(v) before running binsearch
> >
> > >
> > > Hi , I have a vector containing various string numbers , i.e
> > > v[0] = "345"
> > > v[1] = "234"
> > > v[2] = "456"
> > > etc
> > >
> > > when i do binsearch for the first value , the index return is -
> 1 ,
> > all
> > > the others are ok..
> > > I think it's a bug since it has to return 0...
>
> Above should return 1 after sorting if you mean 345. And does in
my
> tests plus other situations I tried. Pls post the exact code of a
> failing example. (No "etc").
>
here's some code (i just wrote a sample which does not work as well)
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)
> > >
> > > Please correct me if i'm wrong...
> > >
> > > thanks
> > >
> > >
> > > avi
> > >
> >
>