Subject | Re: [IBO] EOF BOF craziness |
---|---|
Author | Lester Caine |
Post date | 2003-09-10T09:25:15Z |
> Nextly - I dont see EOF as a state, and dont see why it should be a state.Personally that sums it up for me. There is no mechanism in
> To me EOF is a flag that says 'your last attempt at next failed because you
> are at the end of the dataset'. Also the current 'state', meaning pointing
> to an invalid record past the end of the dataset, does not distinguish
> between an empty dataset and a full one gone off the end.
Firebird to tell you that the current 'Next' is the last
one. So you need a 'Next' to fail to know that you are at
the end.
In my case, 'Next' may well be AT the last record at the
moment, but as other people add records, a further 'Next'
may produce a valid result.
I agree that it is confusing, but I think that BDE always
had it wrong when dealing with client/server databases,
which is perhaps one of the reasons Borland has given up on
it and is trying something else.
So to confuse things even more. EOF should not say 'This is
the last record' because while a further Next may fail now,
but a later read ( after processing the 'last record' ) may
well produce a further record to process. So if you skipped
out because EOF said 'Finished' you miss the next record.
Going in reverse has exactly the same problem.
PHP does not bother with EOF, it simply fails the fetch when
it can't read any more - So YES other tools do drop of the end.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services