Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Micha Nelissen
On Sat, 01 Apr 2006 18:33:10 -0300
Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:

> >> And what about recno? Just define it as -1, or do a quick count to get
> >> the current record number?
> >> 
> Take a look at TCustomSqliteDataset implementation. In its 
> implementation a count is done each time.
> > Store the recno with/in the linked list entry ?
> >
> >   
> It has two drawbacks: increase memory usage and when inserting, deleting 
> all following records must be updated.

An array of records has the same problem, no ? So these are not drawbacks
IMHO.

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Martin Schreiber
On Saturday 01 April 2006 18.06, Joost van der Sluis wrote:
> Further I have a question: now sqldb uses a linked-list record buffer,
> the RecordCount and RecNo properties are something strange.
>
> What should I do with recordcount? I can add a counter which keep track
> of the recordcount. Ie: it does inc(recordcount) if a record is
> appended.
>
> Or I can do a real count of the records, each time recordcount is
> called.
>
> And what about recno? Just define it as -1, or do a quick count to get
> the current record number?
>
RecNo and RecordCount are frequently used in MSEgui, I found them very useful.

Martin
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Luiz Americo Pereira Camara

Micha Nelissen escreveu:

On Sat, 01 Apr 2006 18:06:31 +0200
Joost van der Sluis <[EMAIL PROTECTED]> wrote:

  

Further I have a question: now sqldb uses a linked-list record buffer,
the RecordCount and RecNo properties are something strange.

What should I do with recordcount? I can add a counter which keep track
of the recordcount. Ie: it does inc(recordcount) if a record is
appended.



Keep a counter.
 
  

Or I can do a real count of the records, each time recordcount is
called.



No, too slow.

  

And what about recno? Just define it as -1, or do a quick count to get
the current record number?

Take a look at TCustomSqliteDataset implementation. In its 
implementation a count is done each time.

Store the recno with/in the linked list entry ?

  
It has two drawbacks: increase memory usage and when inserting, deleting 
all following records must be updated.


Luiz


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Joost van der Sluis
On Sat, 2006-04-01 at 18:32 +0200, Michael Van Canneyt wrote:
> > In revision 3111 TBufDataset is almost completely rewritten. I've tested
> > as much as I could, but it could be that you encounter problems with
> > sqldb which weren't there before.
> > 
> > Please test if everything still works ok, and if not, tell me or submit
> > a bug-report.
> > 
> > Further I have a question: now sqldb uses a linked-list record buffer,
> 
> Why ? This goes against the recordset idea ?

Why is that against the recordset idea?

> > the RecordCount and RecNo properties are something strange.
> > 
> > What should I do with recordcount? I can add a counter which keep track
> > of the recordcount. Ie: it does inc(recordcount) if a record is
> > appended.
> > 
> > Or I can do a real count of the records, each time recordcount is
> > called.
> > 
> > And what about recno? Just define it as -1, or do a quick count to get
> > the current record number?
> > 
> > What are your thoughts on this?
> 
> The very idea of TBufDataset was that both recno and recordcount would 
> always be available. So using a linked list is not so good. 
> Why did you change that ?

Mostly because of speed-issues, and this makes the code far more easier.

With the array, if you're iterating through the data, you have to read
the pointer to the buffer in the array, and subsequently the data in the
buffer.

With this new code, the record buffers contain pointers to their
precessor en successor. That makes searching and browsing a lot faster.

The TDataset only asks the 'next' and 'previous' records from the
TBufDataset. Or it uses bookmarks. Well, bookmarks in a linked list are
easy, they are just the pointers to the list-items.

And using mostly 'next' and 'previous', the linked list is the best
solution.

For TDataset it's a different story.

Joost.




JoJo,
  Joost.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Micha Nelissen
On Sat, 01 Apr 2006 18:06:31 +0200
Joost van der Sluis <[EMAIL PROTECTED]> wrote:

> Further I have a question: now sqldb uses a linked-list record buffer,
> the RecordCount and RecNo properties are something strange.
> 
> What should I do with recordcount? I can add a counter which keep track
> of the recordcount. Ie: it does inc(recordcount) if a record is
> appended.

Keep a counter.
 
> Or I can do a real count of the records, each time recordcount is
> called.

No, too slow.

> And what about recno? Just define it as -1, or do a quick count to get
> the current record number?

Store the recno with/in the linked list entry ?

Micha
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Compiler compilation failure

2006-04-01 Thread Felipe Monteiro de Carvalho
Good afternoon,

I did a clean checkout of fpc 2.1 branch and tryed to cycle the
compiler to generate a arm crosscompiler. The compilation fails. I am
using 2.0.2 to compile 2.1.x

I noticed that the file where the error is (ogcoff.pas) changed
recently, so it is probably under modification or something like that,
but I thought It might be good if I comment about this.

My build command is:

PATH=C:\Programas\fpc202\bin\i386-win32;C:\Programas\arm
make cycle CPU_TARGET=arm OS_TARGET=wince

Here are the error messages:

C:/Programas/fpc202/bin/i386-win32/ppc386.exe -Fuarm -Fusystems -Fu../rtl/units/
i386-win32 -Fiarm -FE. -FUarm/units/i386-win32  -darm -dGDB -dBROWSERLOG -dNOOPT
 pp.pas
ogcoff.pas(1451,14) Error: Illegal expression
ogcoff.pas(1451,14) Error: Constant Expression expected
ogcoff.pas(1451,14) Fatal: Syntax error, ":" expected but "BEGIN" found
ogcoff.pas(161,20) Fatal: Compilation aborted
make[1]: *** [ppcrossarm.exe] Error 1
make[1]: Leaving directory `C:/Programas/fpc21/compiler'
make: *** [cycle] Error 2

thanks,
--
Felipe Monteiro de Carvalho
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Michael Van Canneyt


On Sat, 1 Apr 2006, Joost van der Sluis wrote:

> Hi all,
> 
> In revision 3111 TBufDataset is almost completely rewritten. I've tested
> as much as I could, but it could be that you encounter problems with
> sqldb which weren't there before.
> 
> Please test if everything still works ok, and if not, tell me or submit
> a bug-report.
> 
> Further I have a question: now sqldb uses a linked-list record buffer,

Why ? This goes against the recordset idea ?

> the RecordCount and RecNo properties are something strange.
> 
> What should I do with recordcount? I can add a counter which keep track
> of the recordcount. Ie: it does inc(recordcount) if a record is
> appended.
> 
> Or I can do a real count of the records, each time recordcount is
> called.
> 
> And what about recno? Just define it as -1, or do a quick count to get
> the current record number?
> 
> What are your thoughts on this?

The very idea of TBufDataset was that both recno and recordcount would 
always be available. So using a linked list is not so good. 
Why did you change that ?

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Warning for sqldb and fpc 2.1.1 users

2006-04-01 Thread Joost van der Sluis
Hi all,

In revision 3111 TBufDataset is almost completely rewritten. I've tested
as much as I could, but it could be that you encounter problems with
sqldb which weren't there before.

Please test if everything still works ok, and if not, tell me or submit
a bug-report.

Further I have a question: now sqldb uses a linked-list record buffer,
the RecordCount and RecNo properties are something strange.

What should I do with recordcount? I can add a counter which keep track
of the recordcount. Ie: it does inc(recordcount) if a record is
appended.

Or I can do a real count of the records, each time recordcount is
called.

And what about recno? Just define it as -1, or do a quick count to get
the current record number?

What are your thoughts on this?

JoJo,
  Joost.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel