Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-09

Some Dataset and Variants patches

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Index: rtl/objpas/varutils.inc
Aded forgotten initialization
=================================================================== --- rtl/objpas/varutils.inc (revision 1083)
+++ rtl/objpas/varutils.inc (working copy)
@@ -359,6 +359,7 @@

     if ResVAR_OK then
       exit;
     Result^.DimCount:=Dim;

+ Result^.LockCount:=0;

     Result^.Flags:=psaElementFlags[VarType];
     Result^.ElementSize:=psaElementSizes[VarType];
     for i:=0 to Dim-1 do

Index: rtl/objpas/sysutils/sysstr.inc
Repaired AnsiCompareStr
=================================================================== --- rtl/objpas/sysutils/sysstr.inc (revision 1083) +++ rtl/objpas/sysutils/sysstr.inc (working copy) @@ -299,7 +299,7 @@

     Inc(S1);
     Inc(S2);
   Until (Result0) or (S1^=#0) or (S2^=#0);

- if Result=0 then
+ if Result0 then

     if s1=#0 then
       result:=1
     else

Index: fcl/db/dataset.inc
Aded FConstraints and TempBuffer only for possibility to compile my big project ported to fpc
=================================================================== --- fcl/db/dataset.inc (revision 1083)
+++ fcl/db/dataset.inc (working copy)
@@ -27,6 +27,7 @@

   FFieldDefs:=TFieldDefs.Create(Self);
   FFieldList:=TFields.Create(Self);
   FDataSources:=TList.Create;

+ FConstraints := TCheckConstraints.Create(Self); end;

@@ -40,6 +41,7 @@
   Active:=False;
   FFieldDefs.Free;
   FFieldList.Free;
+  FreeAndNil(FConstraints);
   With FDatasources do
     begin
     While Count>0 do
@@ -1882,3 +1884,9 @@
   FDataSources.Remove(ADataSource);
 end;
+Function TDataset.TempBuffer: PChar;
+
+begin
+  //!! To be implemented
+end;
+
Index: fcl/db/db.pp
===================================================================
--- fcl/db/db.pp        (revision 1083)
+++ fcl/db/db.pp        (working copy)
@@ -1044,6 +1044,7 @@
     procedure SetRecNo(Value: Longint); virtual;
     procedure SetState(Value: TDataSetState);
     function SetTempState(const Value: TDataSetState): TDataSetState;
+    function TempBuffer: PChar;
     procedure UpdateIndexDefs; virtual;
     property ActiveRecord: Longint read FActiveRecord;
     property CurrentRecord: Longint read FCurrentRecord;
Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Unknown author
to Joost van der Sluis
Joost van der Sluis wrote
Any reason to re-implement the tempbuffer? Or were you just using an older version?

Please give me more datails (history) about "tempbuffer".

I can look deeply into ZeosLib and find out why it needs tempbuffer. Patch with constraints and tempbuffer is really not important.

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Alexandrov Alexandru
to Joost van der Sluis: Any reason to re-implement the tempbuffer? Or were you just using an older version? Joost.
Joost van der Sluis wrote 10 lines
Any reason to re-implement the tempbuffer? Or were you just using an older version? regards, Joost. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

It seems that there are many delphi compatible components left that use tempbuffer. I have myself reintroduced this function instantly, becouse it is used in filtering/searching operations by my dataset component.
Since this function exists in delphi and it is used by some components, i see no reason not to have it in fpc.

Alex

Reply by email

Luiz Américo
to Alexandrov Alexandru
Alexandrov Alexandru wrote 20 lines
On 9/16/05, Joost van der Sluis wrote: >Any reason to re-implement the tempbuffer? Or were you just using an >older version? > >regards, >Joost. > >_______________________________________________ >fpc-devel maillist - >http://lists.freepascal.org/mailman/listinfo/fpc-devel > It seems that there are many delphi compatible components left that use tempbuffer. I have myself reintroduced this function instantly, becouse it is used in filtering/searching operations by my dataset component. Since this function exists in delphi and it is used by some components, i see no reason not to have it in fpc.

But relying in a function that does nothing / not implemented / acts different from Delphi can lead to problems.

Luiz

Reply by email

Joost van der Sluis
to Unknown author: Please give me more datails (history) about "tempbuffer". I can look deeply into ZeosLib…
> Any reason to re-implement the tempbuffer? Or were you just using an > older version? Please give me more datails (history) about "tempbuffer".

Well, it was an empty procedure. But no-one had a clue where it was used for. Probably it had something to do with some very old fpc-TDataset- descendents. So it got removed.

But if you can find a reason to keep it there... Maybe that ZEOS uses it?

I can look deeply into ZeosLib and find out why it needs tempbuffer. Patch with constraints and tempbuffer is really not important.

Reply by email

Joost van der Sluis
to Alexandrov Alexandru: It seems that there are many delphi compatible components left that use tempbuffer. I…
Show quoted text 6 lines
It seems that there are many delphi compatible components left that use tempbuffer. I have myself reintroduced this function instantly, becouse it is used in filtering/searching operations by my dataset component. Since this function exists in delphi and it is used by some components, i see no reason not to have it in fpc.

Ok, forget my last message then, i'll re-implement it.

Do you also know what it should do?

Regards,
Joost

Reply by email

Unknown author
to Joost van der Sluis: Well, it was an empty procedure. But no-one had a clue where it was used for. Probably it…
Joost van der Sluis wrote 10 lines
> > Any reason to re-implement the tempbuffer? Or were you just using an > > older version? > Please give me more datails (history) about "tempbuffer". Well, it was an empty procedure. But no-one had a clue where it was used for. Probably it had something to do with some very old fpc-TDataset- descendents. So it got removed. But if you can find a reason to keep it there... Maybe that ZEOS uses it?

Now i ZEOS, but TRxMemoryData use it for
record filtering.

Petr

Ing. Petr Kristan . EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice tel: +420 466335223 Czech Republic (Eastern Europe) fax: +420 466510709

Reply by email

Alexandrov Alexandru
to Joost van der Sluis: Ok, forget my last message then, i'll re-implement it. Do you also know what it should do?
Joost van der Sluis wrote 15 lines
> It seems that there are many delphi compatible components left that > use tempbuffer. I have myself reintroduced this function instantly, > becouse it is used in filtering/searching operations by my dataset > component. > Since this function exists in delphi and it is used by some > components, i see no reason not to have it in fpc. Ok, forget my last message then, i'll re-implement it. Do you also know what it should do? Regards, Joost
Function TDataset.TempBuffer: PChar;
begin
  Result := FBuffers[FRecordCount];
end;

The result of this function is used in filtering/searching operations.

Alex

Reply by email