Jason Burgon wrote:
> "Joe" <joe@[EMAIL PROTECTED]
> wrote in message
> news:13mh3qioollci1b@[EMAIL PROTECTED]
>
>> Ok, do you have a way to tell when a database has 0 records in.
>
> The general rule with all lists is to have a "Count" field that contains
the
> number of records or other elements in them. Obviously then, if Count =
0
> then the list is empty.
>
> With zero-based lists, you iterate by going from item 0..Count-1, or
> visa-versa. eg:
>
> for RecNum := 0 to Count - 1 do
> begin
> List[RecNum] := Whatever;
> end;
>
I under stand that, But you have to remember that the 1st record starts
at 0. If I tell it that if the RecNum:= filesize(?); and then I tell it
what to do. Then I miss the 1st record. Get it. and if there is one
record in it then that record starts again, at 0.
type
user = record
name: string[30];
age: string[2];
end;
var
person: file of user;
u: user;
assign(person, 'path\?');
rewrite(person);
recnum:= filesize(person); // This all ways starts at 0. No matter if
there is 1 record in it or not.
if (recnum = 0) then goto ?; //Then I miss the first record.
Does that help


|