Re: [lazarus] Did that but what now??

2006-09-11 Thread Flávio Etrusco


Which one do I use and where should it be?



/home/colin/.fpc.cfg


This is the configuration being used.
When you install with 'root' a global configuration is installed in
"/etc/fpc.cfg", then you wouldn't have to have a the user-only
configuration file, but anyway the user-only file takes precedence
over the global one.

-Flávio

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] I think I found fpc.cfg

2006-09-11 Thread Colin Lehmann
I think I found the right one in .fpc.cfg, the lines I think are 
relevent to the problem are :


# ---
# Set Filenames and Paths
# ---

# Slashes are also allowed under dos

# path to the messagefile, not necessary anymore but can be used to override
# the default language
#-Fr/home/colin/fpc-2.0.4/lib/fpc/$fpcversion/msg/errore.msg
#-Fr/home/colin/fpc-2.0.4/lib/fpc/$fpcversion/msg/errorn.msg

# searchpath for includefiles
#-Fi/pp/inc;/pp/rtl/inc

# searchpath for units and other system dependent things
-Fu/home/colin/fpc-2.0.4/lib/fpc/$fpcversion/units/$fpctarget
-Fu/home/colin/fpc-2.0.4/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/home/colin/fpc-2.0.4/lib/fpc/$fpcversion/units/$fpctarget/rtl
#-Fu~/fpc/packages/base/*/units/;~/fpc/fcl/units/;~/fpc/rtl/units/

# searchpath for libraries
-Fl.
#-Fl/pp/lib
#-Fl/lib;/usr/lib

I am simply using the make file to compile and the result is exactly the 
same as before, still cannot find glib...


Colin

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Did that but what now??

2006-09-11 Thread Vincent Snijders

Colin Lehmann wrote:

Vincent suggested I use the sample script. I did that and now I have

[EMAIL PROTECTED]:~/lazarus/lazarus-0.9.16/usr/lib/lazarus$ locate fpc.cfg
/usr/share/man/man5/fpc.cfg.5.gz
/home/colin/Desktop/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/.Trash/man/man5/fpc.cfg.5
/home/colin/.Trash/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/lazarus/lazarus-0.9.16/usr/lib/lazarus/tools/install/win32/samplefpc.cfg 

/home/colin/lazarus-0.9.16/usr/lib/lazarus/tools/install/win32/samplefpc.cfg/home/colin/fpc-2.0.2/man/man5/fpc.cfg.5 


/home/colin/.fpc.cfg
/home/colin/.fpc.cfg.orig
/home/colin/Downloads/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/fpc-2.0.4/man/man5/fpc.cfg.5



Did you try to compile again?

What error did you get? What fpc version were you using. What units were 
 used (use the fpc -vu or -va option).


Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Did that but what now??

2006-09-11 Thread Colin Lehmann

Vincent suggested I use the sample script. I did that and now I have

[EMAIL PROTECTED]:~/lazarus/lazarus-0.9.16/usr/lib/lazarus$ locate fpc.cfg
/usr/share/man/man5/fpc.cfg.5.gz
/home/colin/Desktop/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/.Trash/man/man5/fpc.cfg.5
/home/colin/.Trash/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/lazarus/lazarus-0.9.16/usr/lib/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/lazarus-0.9.16/usr/lib/lazarus/tools/install/win32/samplefpc.cfg/home/colin/fpc-2.0.2/man/man5/fpc.cfg.5
/home/colin/.fpc.cfg
/home/colin/.fpc.cfg.orig
/home/colin/Downloads/lazarus/tools/install/win32/samplefpc.cfg
/home/colin/fpc-2.0.4/man/man5/fpc.cfg.5

Which one do I use and where should it be?

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] glib....

2006-09-11 Thread Vincent Snijders

Colin Lehmann wrote:
Well I copied all your suggestions to a text file, transferred that file 
to my Windows machine and printed it out (I can't get my printer to work 
with Linux either...). It look like I am missing glib.pp, assuming *.pp 
is the pascal source?

I found lots of ppu files :
[EMAIL PROTECTED]:~$ locate glib.pp
/usr/lib/fpc/2.0.2/units/i386-linux/gtk/glib.ppu
/home/colin/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/gtk/glib.ppu
/home/colin/fpc-2.0.2/lib/fpc/2.0.2/units/i386-linux/gtk/glib.ppu
/home/colin/fpc-2.0.4/lib/fpc/2.0.4/units/i386-linux/gtk/glib.ppu

but not a single glib.pp. I assume *.ppu is the unit file the same as a 
DCU in Delphi? If this is the case, do I need the glib.pp file at all?


Marc asks if I have added the path to the lazarus search path correctly?

Where do I find 'the lazarus search path'?

Albert suggests I check my fpc.conf, I cannot find this file either with 
locate or find I looked in /etc but the nearest I could see was 
lftp.conf


So I am still on square one!!



Your fpc installation is/was not complete. You miss a ~/.fpc.cfg (or 
your /etc/fpc.cfg still points to the fpc 2.0.2 unit directories. Create 
one using the samplecfg script in /home/colin/fpc-2.0.4/lib/fpc/2.0.4.


Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] glib....

2006-09-11 Thread Colin Lehmann
Well I copied all your suggestions to a text file, transferred that file 
to my Windows machine and printed it out (I can't get my printer to work 
with Linux either...). It look like I am missing glib.pp, assuming *.pp 
is the pascal source?

I found lots of ppu files :
[EMAIL PROTECTED]:~$ locate glib.pp
/usr/lib/fpc/2.0.2/units/i386-linux/gtk/glib.ppu
/home/colin/fpc-2.0.2/lib/fpc/2.0.2/units/i386-freebsd/gtk/glib.ppu
/home/colin/fpc-2.0.2/lib/fpc/2.0.2/units/i386-linux/gtk/glib.ppu
/home/colin/fpc-2.0.4/lib/fpc/2.0.4/units/i386-linux/gtk/glib.ppu

but not a single glib.pp. I assume *.ppu is the unit file the same as a 
DCU in Delphi? If this is the case, do I need the glib.pp file at all?


Marc asks if I have added the path to the lazarus search path correctly?

Where do I find 'the lazarus search path'?

Albert suggests I check my fpc.conf, I cannot find this file either with 
locate or find I looked in /etc but the nearest I could see was 
lftp.conf


So I am still on square one!!

Thanks for all your help, maybe I am simply a bit thick?

Colin

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: Media attention

2006-09-11 Thread Luis R. Hilario B.

http://barrapunto.com/article.pl?sid=06/09/11/2329221&mode=thread
:)

2006/9/11, Luis R. Hilario B. <[EMAIL PROTECTED]>:

Hello,

We have the attention of the media, so smile to the public. :)
--
http://luisdigital.com




--
http://luisdigital.com

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Media attention

2006-09-11 Thread Luis R. Hilario B.

Hello,

We have the attention of the media, so smile to the public. :)
--
http://luisdigital.com

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] How can I implement Items.Add ?

2006-09-11 Thread Marc Weustink

Felipe Monteiro de Carvalho wrote:

Hello,

How can I implement ListBox1.Items.Add and the similar for TComboBox ?

On TWSListBox there is a method to return the strings of the control,
but there is no method to add strings to the control. I also could not
find this anywhere else.

This problem appeared when implementing some controls on the qt interface.


Look at the implementation of TGtkCListStringList

TWSCustomListBox.GetStrings returns a TStrings decendant created by the 
widgetset itself. So when items are added or removed, this decendant 
knows it and takes action.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TDrawGrid flickering

2006-09-11 Thread Ewald Horn

Hi

DefaultDrawing is off, but I think I have too much things happening in the 
update loop. Is there a way to disable the update until some processing is 
done in a TdrawGrid or any other component for that matter ?


Regards
Ewald Horn 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TDrawGrid flickering

2006-09-11 Thread Jesus Reyes

 --- Ewald Horn <[EMAIL PROTECTED]> escribió:

> Hi,
> 
> I've coded a TDrawGrid and the second I start displaying images I
> get a 
> weird flicker on the grid. As long as I don't use images, it's
> working fine. 
> Is there a way to display an image on the TDrawGrid, cell by cell,
> while 
> avoiding the nasty refresh flickering ?
> 
> Currently I implement
> 
> procedure MainGridDrawCell(Sender: TObject; aCol, aRow: Integer;
> aRect: 
> TRect; aState: TGridDrawState);
> 
> and that's about all.
> 
> I've run out of ideas :)
> 
> Regards
> Ewald
> 


It would be best if you could submit a test project but guessing,
have you turned DefaultDrawing off?

Jesus Reyes A.





___ 
Do You Yahoo!? 
La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] How can I implement Items.Add ?

2006-09-11 Thread Felipe Monteiro de Carvalho

Hello,

How can I implement ListBox1.Items.Add and the similar for TComboBox ?

On TWSListBox there is a method to return the strings of the control,
but there is no method to add strings to the control. I also could not
find this anywhere else.

This problem appeared when implementing some controls on the qt interface.

thanks,
--
Felipe Monteiro de Carvalho

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] TDrawGrid flickering

2006-09-11 Thread Ewald Horn

Hi,

I've coded a TDrawGrid and the second I start displaying images I get a 
weird flicker on the grid. As long as I don't use images, it's working fine. 
Is there a way to display an image on the TDrawGrid, cell by cell, while 
avoiding the nasty refresh flickering ?


Currently I implement

procedure MainGridDrawCell(Sender: TObject; aCol, aRow: Integer; aRect: 
TRect; aState: TGridDrawState);


and that's about all.

I've run out of ideas :)

Regards
Ewald

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TSelectDirectoryDialog under Linux vs Windows

2006-09-11 Thread Graeme Geldenhuys

Thanks Michael.  If it is something small, I will create a patch,
otherwise create a bug report in Mantis.

Regards,
 - Graeme -



On 9/11/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:



On Mon, 11 Sep 2006, Vincent Snijders wrote:

> Michael Van Canneyt schreef:
>>
>>
>> On Mon, 11 Sep 2006, Graeme Geldenhuys wrote:
>>
>>> Sorry, I meant the TSelectDirectoryDialog component and _not_ TOpenDialog.
>>>
>>> G.
>>>
>>> --
>>>
>>> When using the TSelectDirectoryDialog to select directories, under Linux
>>> the
>>> TSelectDirectoryDialog.Filename has an ending PathDelimiter ('/'), but
>>> under
>>> Windows in doesn't.
>>>
>>> Is this normal OS behaviour or a bug?
>>
>> This is a bug. You should be able to rely on the fact that it ends (or does
>> not end) on a pathdelimiter. The linux behaviour is the only possible
>> behaviour...
>
> Why the only possible behavior?

How else will you indicate e.g. the root directory ? Empty String ?
Empty would be the current directory.

It's also consistent with functions like ExtractFilePath, ExtractRelativePath, 
which
all expect an pathdelimiter at the end or return a pathdelimiter.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives




--
There's no place like 127.0.0.1

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TSelectDirectoryDialog under Linux vs Windows

2006-09-11 Thread Michael Van Canneyt



On Mon, 11 Sep 2006, Vincent Snijders wrote:


Michael Van Canneyt schreef:



On Mon, 11 Sep 2006, Graeme Geldenhuys wrote:


Sorry, I meant the TSelectDirectoryDialog component and _not_ TOpenDialog.

G.

--

When using the TSelectDirectoryDialog to select directories, under Linux 
the
TSelectDirectoryDialog.Filename has an ending PathDelimiter ('/'), but 
under

Windows in doesn't.

Is this normal OS behaviour or a bug?


This is a bug. You should be able to rely on the fact that it ends (or does 
not end) on a pathdelimiter. The linux behaviour is the only possible 
behaviour...


Why the only possible behavior?


How else will you indicate e.g. the root directory ? Empty String ? 
Empty would be the current directory.


It's also consistent with functions like ExtractFilePath, ExtractRelativePath, 
which
all expect an pathdelimiter at the end or return a pathdelimiter.

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TSelectDirectoryDialog under Linux vs Windows

2006-09-11 Thread Vincent Snijders

Michael Van Canneyt schreef:



On Mon, 11 Sep 2006, Graeme Geldenhuys wrote:

Sorry, I meant the TSelectDirectoryDialog component and _not_ 
TOpenDialog.


G.

--

When using the TSelectDirectoryDialog to select directories, under 
Linux the
TSelectDirectoryDialog.Filename has an ending PathDelimiter ('/'), but 
under

Windows in doesn't.

Is this normal OS behaviour or a bug?


This is a bug. You should be able to rely on the fact that it ends (or 
does not end) on a pathdelimiter. The linux behaviour is the only 
possible behaviour...


Why the only possible behavior?

Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TSelectDirectoryDialog under Linux vs Windows

2006-09-11 Thread Michael Van Canneyt



On Mon, 11 Sep 2006, Graeme Geldenhuys wrote:


Sorry, I meant the TSelectDirectoryDialog component and _not_ TOpenDialog.

G.

--

When using the TSelectDirectoryDialog to select directories, under Linux the
TSelectDirectoryDialog.Filename has an ending PathDelimiter ('/'), but under
Windows in doesn't.

Is this normal OS behaviour or a bug?


This is a bug. 
You should be able to rely on the fact that it ends (or does not end) 
on a pathdelimiter. The linux behaviour is the only possible behaviour...


Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] TSelectDirectoryDialog under Linux vs Windows

2006-09-11 Thread Graeme Geldenhuys

Sorry, I meant the TSelectDirectoryDialog component and _not_ TOpenDialog.

G.

--

When using the TSelectDirectoryDialog to select directories, under Linux the
TSelectDirectoryDialog.Filename has an ending PathDelimiter ('/'), but under
Windows in doesn't.

Is this normal OS behaviour or a bug?

For example:

Linux:/temp/test/
Windows:  C:\temp\test


Regards,
  - Graeme -


--
There's no place like 127.0.0.1

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] TOpenDialog under Linux vs Windows

2006-09-11 Thread Graeme Geldenhuys

Hi,

When using the TOpenDialog to select directories, under Linux the
TOpenDialog.Filename has an ending PathDelimiter ('/'), but under
Windows in doesn't.

Is this normal OS behaviour or a bug?

For example:

Linux:/temp/test/
Windows:  C:\temp\test


Regards,
 - Graeme -


--
There's no place like 127.0.0.1

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Fast Named InterfaceList access

2006-09-11 Thread Cesar Romero

Thank you Albert
Yep, I saw, now I have a new version using that, and is working fine:

 PInterfaceItem = ^TInterfaceItem;
 TInterfaceItem = record
   Item: IInterface;
   Name1: PChar;
   Name2: PChar;
 end;

 TNamedInterfaceList = class(TInterfacedObject, INamedInterfaceList)
 private
   FDoubleNamed: boolean;
   FCaseSensitive: Boolean;
   FHashList1: TStringHash;
   FHashList2: TStringHash;
   FItems: TList;
   FLock: TCriticalSection;
   function GetCaseSensitive: Boolean;
   function GetCount: Integer;
   function GetItem(const Name: string): IInterface;
   function GetItems(const Index: Integer): IInterface;
   procedure SetCaseSensitive(const Value: Boolean);
   procedure SetItem(const Name: string; const Value: IInterface);
   procedure SetItems(const Index: Integer; const Value: IInterface);

   procedure ReHash;
 protected
   function Add(const Name: string; const Item: IInterface): Integer; 
overload;
   function Add(const Name1, Name2: string; const Item: IInterface): 
Integer; overload;

   function IndexOf(const Item: IInterface): Integer; overload;
   function IndexOf(const Name: string; const Name2: boolean = False): 
Integer; overload;

   procedure Exchange(const Index1, Index2: Integer);

   procedure Clear;
   procedure Delete(const Index: Integer); overload;
   procedure Delete(const Name: string; const Name2: boolean = False); 
overload;

 public
   constructor Create(const DoubleNamed: boolean = False; const 
HashSize: Integer = 389);

   destructor Destroy; override;

   procedure Lock;
   procedure Unlock;

   property CaseSensitive: Boolean read GetCaseSensitive write 
SetCaseSensitive;

   property Count: Integer read GetCount;
   property Item[const Name: string]: IInterface read GetItem write 
SetItem;
   property Items[const Index: Integer]: IInterface read GetItems write 
SetItems; default;

 end;


Albert Zeyer escreveu:

I don't think so.
You have another problem with your current implementation: The 
reference counting of your interfaces will not work. You have to call 
manually the _AddRef and _Release of the interface after adding them 
to the list and removing them. You also can't use FList.Clear, because 
then the reference counting doen't work either.



Am Samstag, den 09.09.2006, 20:10 -0300 schrieb Cesar Romero:

Can someone suggest a better way to do that?

Now Im using:


  THashedInterfaceList = class(TInterfacedObject, IHashedInterfaceList)
  private
FList: THashedStringList;
  protected
function Add(const Name: string; const Item: IInterface): Integer;
function GetCount: Integer;
function GetItem(const Name: string): IInterface;
function GetItems(const Index: Integer): IInterface;

function IndexOf(const Name: string): Integer;
function IndexOfItem(const Item: IInterface): Integer;
procedure Clear;
procedure Delete(const Index: Integer);

property Item[const Name: string]: IInterface read GetItem;
property Items[const Index: Integer]: IInterface read GetItems; default;
property Count: Integer read GetCount;
  public
constructor Create(const SortList: boolean = False); virtual;
destructor Destroy; override;
  end;

function THashedInterfaceList.Add(const Name: string;
  const Item: IInterface): Integer;
begin
  Result:= FList.AddObject(Name, Pointer(Item));
end;

procedure THashedInterfaceList.Clear;
begin
  FList.Clear;
end;

constructor THashedInterfaceList.Create(const SortList: boolean);
begin
  inherited Create;
  FList:= THashedStringList.Create;
  FList.Duplicates:= dupError;
  FList.Sorted:= SortList;
end;

procedure THashedInterfaceList.Delete(const Index: Integer);
begin
  FList.Delete(Index);
end;

destructor THashedInterfaceList.Destroy;
begin
  FList.Free;
  inherited;
end;

function THashedInterfaceList.GetCount: Integer;
begin
  Result:= FList.Count;
end;

function THashedInterfaceList.GetItem(const Name: string): IInterface;
begin
  Result:= Items[IndexOf(Name)];
end;

function THashedInterfaceList.GetItems(const Index: Integer): IInterface;
var
  LItem: Pointer;
begin
  if (Index <> NotFound) and (Index < Count) then
LItem:= FList.Objects[Index]
  else
LItem:= nil;

  Result:= IInterface(LItem);
end;

function THashedInterfaceList.IndexOf(const Name: string): Integer;
begin
  Result:= FList.IndexOf(Name);
end;

function THashedInterfaceList.IndexOfItem(const Item: IInterface): Integer;
begin
  Result:= FList.IndexOfObject(Pointer(Item));
end;

_
 To unsubscribe: mail [EMAIL PROTECTED]  with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives




_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Database programming

2006-09-11 Thread Graeme Geldenhuys

On 9/11/06, Michael Van Canneyt <[EMAIL PROTECTED]> wrote:

>> 1024 simultaneous connections  is hard coded in Firebird engine (1.5.x
>> at least)
>
>
> My larger clients better fire some staff then...  :-)
> I will have to look into that, thanks.

Connection pooling can solve this, or a simple recompilation of the firebird
server. But connection pooling is simple in firebird, due to the way
transactions are used...

Michael.


Would connection pooling solve the problem for C/S based apps, or only
for n-tier apps?
My apps only ever create one connection each. It shares it's
connection internally,etc, but if 20 users each run the app, that is
at least 20 connections.  That means I can only run 1024 instances of
my app.

It shouldn't be to much of a issue to change my app to a 3-tier app,
though the installation process will change. :-(  My persistence
framework (tiOPF) allows for the switch form C/S to 3-tier without
major code changes.

Regards,
 - Graeme -

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Fast Named InterfaceList access

2006-09-11 Thread Albert Zeyer




I don't think so.
You have another problem with your current implementation: The reference counting of your interfaces will not work. You have to call manually the _AddRef and _Release of the interface after adding them to the list and removing them. You also can't use FList.Clear, because then the reference counting doen't work either.


Am Samstag, den 09.09.2006, 20:10 -0300 schrieb Cesar Romero:


Can someone suggest a better way to do that?

Now Im using:


  THashedInterfaceList = class(TInterfacedObject, IHashedInterfaceList)
  private
FList: THashedStringList;
  protected
function Add(const Name: string; const Item: IInterface): Integer;
function GetCount: Integer;
function GetItem(const Name: string): IInterface;
function GetItems(const Index: Integer): IInterface;

function IndexOf(const Name: string): Integer;
function IndexOfItem(const Item: IInterface): Integer;
procedure Clear;
procedure Delete(const Index: Integer);

property Item[const Name: string]: IInterface read GetItem;
property Items[const Index: Integer]: IInterface read GetItems; default;
property Count: Integer read GetCount;
  public
constructor Create(const SortList: boolean = False); virtual;
destructor Destroy; override;
  end;

function THashedInterfaceList.Add(const Name: string;
  const Item: IInterface): Integer;
begin
  Result:= FList.AddObject(Name, Pointer(Item));
end;

procedure THashedInterfaceList.Clear;
begin
  FList.Clear;
end;

constructor THashedInterfaceList.Create(const SortList: boolean);
begin
  inherited Create;
  FList:= THashedStringList.Create;
  FList.Duplicates:= dupError;
  FList.Sorted:= SortList;
end;

procedure THashedInterfaceList.Delete(const Index: Integer);
begin
  FList.Delete(Index);
end;

destructor THashedInterfaceList.Destroy;
begin
  FList.Free;
  inherited;
end;

function THashedInterfaceList.GetCount: Integer;
begin
  Result:= FList.Count;
end;

function THashedInterfaceList.GetItem(const Name: string): IInterface;
begin
  Result:= Items[IndexOf(Name)];
end;

function THashedInterfaceList.GetItems(const Index: Integer): IInterface;
var
  LItem: Pointer;
begin
  if (Index <> NotFound) and (Index < Count) then
LItem:= FList.Objects[Index]
  else
LItem:= nil;

  Result:= IInterface(LItem);
end;

function THashedInterfaceList.IndexOf(const Name: string): Integer;
begin
  Result:= FList.IndexOf(Name);
end;

function THashedInterfaceList.IndexOfItem(const Item: IInterface): Integer;
begin
  Result:= FList.IndexOfObject(Pointer(Item));
end;

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives







Re: [lazarus] Database programming

2006-09-11 Thread Michael Van Canneyt



On Mon, 11 Sep 2006, Graeme Geldenhuys wrote:


On 9/11/06, Bogusaw Brandys <[EMAIL PROTECTED]> wrote:

> Yup!  With our Delphi apps, we have done 100's but not yet 1000's.  We
> don't have big enough clients to test 1000+ connections in our app.
>
> Regards,
>  - Graeme -
>

1024 simultaneous connections  is hard coded in Firebird engine (1.5.x
at least)



My larger clients better fire some staff then...  :-)
I will have to look into that, thanks.


Connection pooling can solve this, or a simple recompilation of the firebird 
server. But connection pooling is simple in firebird, due to the way

transactions are used...

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Database programming

2006-09-11 Thread Graeme Geldenhuys

On 9/11/06, Bogusław Brandys <[EMAIL PROTECTED]> wrote:

> Yup!  With our Delphi apps, we have done 100's but not yet 1000's.  We
> don't have big enough clients to test 1000+ connections in our app.
>
> Regards,
>  - Graeme -
>

1024 simultaneous connections  is hard coded in Firebird engine (1.5.x
at least)



My larger clients better fire some staff then...  :-)
I will have to look into that, thanks.


Regards,
 - Graeme -

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Database programming

2006-09-11 Thread Bogusław Brandys

Graeme Geldenhuys wrote:

On 9/6/06, Micha Nelissen <[EMAIL PROTECTED]> wrote:

Does Firebird support 100s to 1000s of clients ?


Yup!  With our Delphi apps, we have done 100's but not yet 1000's.  We
don't have big enough clients to test 1000+ connections in our app.

Regards,
 - Graeme -



1024 simultaneous connections  is hard coded in Firebird engine (1.5.x 
at least)




Regards
Boguslaw

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Installing....

2006-09-11 Thread Albert Zeyer




If you have updatet FPC last time, check the correctness of the unit-path in your /etc/fpc.conf.
I had the same error on saterday and this was my fault.

Albert


Am Montag, den 11.09.2006, 08:54 +0700 schrieb Colin Lehmann:


I have been struggling with the installation of Lazarus for two days. I 
now get after the MAKE CLEAN ALL the 'compilation aborted' error with 
"Can't find unit glib'.
Where is glib supposed to be? What is its full name? Where do I insert 
it so the compiler can find it?
I downloaded the glib package but it didn't help

Help!!

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives







Re: [lazarus] Installing....

2006-09-11 Thread Mattias Gaertner
On Mon, 11 Sep 2006 08:54:18 +0700
Colin Lehmann <[EMAIL PROTECTED]> wrote:

> I have been struggling with the installation of Lazarus for two days.
> I now get after the MAKE CLEAN ALL the 'compilation aborted' error
> with "Can't find unit glib'.

Have you tried the FAQ:
http://wiki.lazarus.freepascal.org/Lazarus_Faq#When_compiling_lazarus_the_compiler_can_not_find_a_unit._e.g.:_gtkint.pp.2817.2C16.29_Fatal:_Can.27t_find_unit_GLIB


Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Database programming

2006-09-11 Thread Michael Van Canneyt



On Fri, 8 Sep 2006, Micha Nelissen wrote:


Eduardo wrote:

Here you have some benchmarks (posted in sqlite mail list, so "perhaps"
are biased)

http://sqlite.phxsoftware.com/forums/thread/622.aspx


How 'real-world' is importing 300 thousand records ? Aren't complex
select queries *much* more important ?


Yes, they are. And there sqlite fails miserably. I wrote a series of
articles, comparing several embeddable databases:
 sqlite
 mysql
 firebird
 advantage
 nexusdb
And while sqlite had very good insert and simple select speeds, the speed
of complex queries (joining 2 tables) was a total disaster.

Plus, and this is really what killed it for me: it does no type checking.
You can perfectly store a string in an integer field in sqlite; making it
impossible to use properly with TDataset.
It can be done, but you can get weird errors because MyIntField.AsInteger will
raise an exception of some other app stored a string in the integer.

I never understood what the big fuss is with sqlite. It's easy, yes, but 
not fit for enterprise use.


Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives