On Sep 29, 2010, at 6:35 PM, Paul McNett wrote:
> I wish biz.seek() returned a bool, not the row number. I never care what row
> number
> was found - I could query biz.RowNumber after seek() if I did - and returning
> a bool
> would simplify my calls from, for example:
>
> if biz.seek(candidate_id, "id") >= 0:
>
> to:
>
> if biz.seek(candidate_id, "id"):
>
> I know it is only a little bit shorter but that's not the real point: I
> always have
> to remember to check for the case of the 0 return value (which means a match
> was
> found at row 0, not that a match wasn't found). If I forget, a potentially
> very
> subtle bug creeps in.
>
> I guess we'd need to define a new function instead though, to avoid breaking
> existing
> code?
The bool aspect kinda fails with near=True, right?
seek() is not "tell me if this value exists", it's more of "move to the
first record with this value, or (optionally) the closest record to this value
without exceeding it".
Do you want the pointer to move? Or do you just want to test for the
existence of the value?
What would you suggest for a name for this new behavior?
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]