Re: why not use function for first, next, previous and last ?
From: Tony J Hopkinson (myname_at_hotmail.com)
Date: 01/07/04
- Next message: Pascal Schmidt-Volkmar: "Re: How does this stored procedure works??"
- Previous message: Pascal Schmidt-Volkmar: "How does this stored procedure works??"
- In reply to: Skybuck Flying: "why not use function for first, next, previous and last ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Pascal Schmidt-Volkmar: "Re: How does this stored procedure works??"
- Previous message: Pascal Schmidt-Volkmar: "How does this stored procedure works??"
- In reply to: Skybuck Flying: "why not use function for first, next, previous and last ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|