Re: EDS request

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mike Sabal writes:
> The problem is this: say I have the following keys:
>
> 011234567BLA
> 011234567WHI
> 011234567BLU
> 011234567RED
> 012345678BLA
>
> I want to get all the records whose keys start with "011234567".

Use: db_find_key("011234567")
         db_find_key("012345678")

These will both fail, but they will both return a
negative number that indicates the position that
these keys would occupy in the table if they were inserted.
Use these negative results to set up a for loop, e.g.
a = -a
b = -b
for rec = a to b-1 do
      ...
end for

db_find_key() uses binary search, so it's quite fast.

This feature wasn't documented very well.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu