Re: why not use function for first, next, previous and last ?

From: Tony J Hopkinson (myname_at_hotmail.com)
Date: 01/07/04


Date: Wed, 07 Jan 2004 19:42:02 GMT

On Wed, 7 Jan 2004 11:55:21 +0100, "Skybuck Flying"
<nospam@hotmail.com> wrote:

>Hi,
>
>TDataSet.First is implemented as a procedure...
>
>( Same goes for next, prev and last )
>
>Why not implement these procedures as functions which return a boolean when
>they succeed.
>
>Then it would be possible to do this:
>
>if DataSet.First then
>repeat
>
>until not DataSet.Next;
>
>Which is a really short and easy way to walk through all records in a
>dataset.
>
>Bye,
> Skybuck.
>

Because it would confuse the hell out of the rest of us who've got
used to them.
In your code snippet above where would dataset be pointing if the
dataset was empty ?
If you used a while loop as in
While Not Next then you'd always miss the first record in the dataset

Same problem with last and not dataset.prev



Relevant Pages

  • Assistance Needed
    ... I am trying to make a simple loop that will check a database field, ... It does the first record just fine, ... Prev by Date: ...
    (microsoft.public.access.modulesdaovba)
  • IDENT_CURRENT and empty table
    ... why the IDENT_CURRENT from an empty table is 1? ... After insert of the first record it is still 1 (assuming that start value ... Helmut ... Prev by Date: ...
    (comp.databases.ms-sqlserver)
  • fly away?
    ... If I just refresh it restores the order but you land on the ... first record not the one that you were on.... ... Prev by Date: ...
    (borland.public.delphi.database.ado)
  • RE: Adding a new record from a form
    ... The person only has to enter the ID on the first record. ... > form and then they can just add their new records without retyping the ... > location field to be filled in on the new record. ... Prev by Date: ...
    (microsoft.public.access.forms)
  • Re: combo box value repeats in database view
    ... Do you mean the first record? ... HTH ... Marc ... Prev by Date: ...
    (microsoft.public.access.gettingstarted)

Loading