Board index » delphi » TkbmMemTable Bug?

TkbmMemTable Bug?

Has anybody else experienced problems setting a range in a TkbmMemTable and
going through it till Eof?  For some reason I get caught in a continuous
loop and I can't for the life of me find out why... What will happen is I
will go through the first few records ( usually all records until 2nd, 3rd,
or 4th last record) and all of a sudden it will stop working and go all
wizzy in an infinite loop.  Here's the code, I don't think it's anything I'm
doing because the code works perfect in TClientDataSets and TTables... and
since TkbmMemTable is a descendant from TDataSet as well, I'd be quite
surprised.  Anyways, here goes:

with FleetDisplay do
  begin
   CancelRange();
    First();
    TmpIdx := IndexName;
    IndexName := 'Edited';
    SetRange( [ true ], [ true ] );
    First();

    While not Eof do
    begin
     FleetRec.Fleet_ID          := FleetDisplayFleet_ID.AsInteger;
      FleetRec.User_Count    := FleetDisplayUser_Count.AsInteger;
      FleetRec.Date_Expire   := FleetDisplayDate_Expire.AsDateTime;
      FleetRec.Name             := FleetDisplayName.AsString;

      Output( Stream, PID_RECORDATA, SizeOf( byte ) );
      Stream.Write( Pid, SizeOf( byte ) );
      Stream.Write( FleetRec, SizeOf( TFleetTblData ) );

      Edit();
      FleetDisplayEdited.AsBoolean := false;
     Post();

    end;

    CancelRange();
    IndexName := TmpIdx;
  end;

Any ideas?

- ryan

 

Re:TkbmMemTable Bug?


Hi,

I have answered this both on the memtable group at
http://www.yahoogroups.com/group/memtable and in the Thirdparty newsgroup.

best regards
Kim Madsen
k...@optical.dk

"Ryan Baldwin" <ry...@traxis.ca> skrev i en meddelelse
news:3b8e9042_2@dnews...

Quote
> Has anybody else experienced problems setting a range in a TkbmMemTable
and
> going through it till Eof?  For some reason I get caught in a continuous
> loop and I can't for the life of me find out why... What will happen is I
> will go through the first few records ( usually all records until 2nd,
3rd,
> or 4th last record) and all of a sudden it will stop working and go all
> wizzy in an infinite loop.  Here's the code, I don't think it's anything
I'm
> doing because the code works perfect in TClientDataSets and TTables... and
> since TkbmMemTable is a descendant from TDataSet as well, I'd be quite
> surprised.  Anyways, here goes:

> with FleetDisplay do
>   begin
>    CancelRange();
>     First();
>     TmpIdx := IndexName;
>     IndexName := 'Edited';
>     SetRange( [ true ], [ true ] );
>     First();

>     While not Eof do
>     begin
>      FleetRec.Fleet_ID          := FleetDisplayFleet_ID.AsInteger;
>       FleetRec.User_Count    := FleetDisplayUser_Count.AsInteger;
>       FleetRec.Date_Expire   := FleetDisplayDate_Expire.AsDateTime;
>       FleetRec.Name             := FleetDisplayName.AsString;

>       Output( Stream, PID_RECORDATA, SizeOf( byte ) );
>       Stream.Write( Pid, SizeOf( byte ) );
>       Stream.Write( FleetRec, SizeOf( TFleetTblData ) );

>       Edit();
>       FleetDisplayEdited.AsBoolean := false;
>      Post();

>     end;

>     CancelRange();
>     IndexName := TmpIdx;
>   end;

> Any ideas?

> - ryan

Other Threads