On 12/22/07 8:48 AM, in article 13mq5vi2bqc84a7@[EMAIL PROTECTED]
"Joe"
<joe@[EMAIL PROTECTED]
> wrote:
> Jim Leonard wrote:
>> On Dec 18, 9:17 pm, Joe <j...@[EMAIL PROTECTED]
> wrote:
>>>> All programmers worth their salt start counting from 0. The more
>>>> experienced a programmer you become, the more you'll understand why.
>>> Ok, do you have a way to tell when I database has 0 records in. That
way
>>> I would be able to tell the program what to do. That way I could avoid
>>> all these crashes
>>
>> You maintain a variable that has a count of how many records exist.
>> For example, "NumRecords".
>
> Ok, I guess no one is getting the idea here. Jim. I know that.
>
> NumRecords:= filesize(U);
>
> The line above returns all the records. You must remember that the first
> record starts at '0'. Not at 1. So my question is how to I tell if the
> (U) has one record or no records in it.
>
> if (NumRecords = 0) then exit;
>
> the line above by p***** the first record. The first record all ways
> starts at 0.
>
I think everybody understands you are not a programmer.
Question: What does filesize return for an empty file? If it returns 0 for
both an empty file and a file with 1 record, then you need another method
for determining if a file is empty, which probably exists.
Depends on your flavor of Pascal and/or available functions.


|