Subject | Re: [IBO] EOF BOF craziness |
---|---|
Author | Daniel Rail |
Post date | 2003-09-10T00:07:26Z |
Hi,
At September 9, 2003, 20:17, Paul Vinkenoog wrote:
Here's the behavior of TDataset.EOF, taken from Delphi's help and
TDataset is not the BDE:
"Test Eof (end-of-file) to determine if the active record in a dataset
is the last record. If Eof is True, the current record is
unequivocally the last row in the dataset. Eof is True when an
application:
- Opens an empty dataset.
- Calls a datasetÂ’s Last method. (Unless it is a unidirectional
dataset)
- Call a datasetÂ’s Next method, and the method fails because the
current record is already the last row in the dataset.
- Calls SetRange on an empty range or dataset.
Eof is False in all other cases.
Tip: If both Eof and Bof are True, the dataset or range is empty."
And, the equivalent can be said for the BOF property.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At September 9, 2003, 20:17, Paul Vinkenoog wrote:
> Leaving the row pointer at the last record when reaching Eof could beThat is TDataset's behavior.
> done in two ways:
> 1. - While stepping through records using Next, Eof is false.
> - When you reach the last record, Eof is still false.
> - After another Next, you stay on the last record but Eof becomes
> true.
> This doesn't feel right to me, because now there are two states you
> can be in while at the last record: one not Eof, and one Eof.
> Also, what would you do upon a Prior if Eof is true and you are on
> the last record:
> a) Just turn off Eof and stay on the last record? This would be
> logical because it preserves Prior-Next symmetry.
> b) Turn off Eof and go to the last-but-one record? Also logical,
> because after all Prior means "go back one record".
Here's the behavior of TDataset.EOF, taken from Delphi's help and
TDataset is not the BDE:
"Test Eof (end-of-file) to determine if the active record in a dataset
is the last record. If Eof is True, the current record is
unequivocally the last row in the dataset. Eof is True when an
application:
- Opens an empty dataset.
- Calls a datasetÂ’s Last method. (Unless it is a unidirectional
dataset)
- Call a datasetÂ’s Next method, and the method fails because the
current record is already the last row in the dataset.
- Calls SetRange on an empty range or dataset.
Eof is False in all other cases.
Tip: If both Eof and Bof are True, the dataset or range is empty."
And, the equivalent can be said for the BOF property.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)