Board index » delphi » D3 TListBox Items limit?

D3 TListBox Items limit?

Hi,

In D3, using TListBox and TIniFile, what is the limit of entries? I don't
know if TIniFile has some limit of strings that it can handle. Is the
lower limit in TListBox or TIniFile?What are those limits?

I am using a TListBox to view and edit (with TIniFile) what is basically
an INI type file, a Section with String Values. And would like to know
the upper limit of the number of entries I can expect to be able to edit.

Thank you,
--
Ken

 

Re:D3 TListBox Items limit?


On Thu, 4 Jun 1998 09:52:14 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
wrote:

Quote
> In D3, using TListBox and TIniFile, what is the limit of entries?

The limits are imposed by Microsoft Windows, not Delphi, since the
TListBox component encapsulates the standard Windows listbox control,
and the TIniFile class encapsulates the standard Windows ini file.

The Windows limitation on listboxes is ~32K lines. The Windows
limitation on ini files is ~64K total size.

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Re:D3 TListBox Items limit?


In article <3576dd6b.21456...@forums.borland.com>, r...@fenestra.com
says...

Hi,

Thanks for your reply.

Quote
> On Thu, 4 Jun 1998 09:52:14 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
> wrote:

> > In D3, using TListBox and TIniFile, what is the limit of entries?

> The limits are imposed by Microsoft Windows, not Delphi, since the

> The Windows limitation on listboxes is ~32K lines. The Windows
> limitation on ini files is ~64K total size.

The 64K size INI file limit sounds familiar, but I would like
to clarify about the listbox. The listbox has a limit of about
32K lines, not 32K size?

If it is lines, I wonder what I am seeing in trying to load
an INI file with more than 1030 lines, each line being about
12 to 30 characters in length. The lines begin with a prefix in the
format of XXX_1234=String. I am stripping the prefix and then loading
the string after the =.

What is happening is that if I try to load 1049 lines, I only see
1029. The other lines are not loaded into the listbox.

Thanks for any information.

Re:D3 TListBox Items limit?


On Thu, 4 Jun 1998 15:18:40 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
wrote:

Quote
> The listbox has a limit of about 32K lines, not 32K size?

I think lines, but someone else will have to confirm.

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Re:D3 TListBox Items limit?


In article <MPG.fe0bd1b6dfc9ae8989...@forums.borland.com>, Ken Hale
wrote:

Quote
> I would like
> to clarify about the listbox. The listbox has a limit of about
> 32K lines, not 32K size?

PMFJI but if this is a limitation to you the Orpheus list box has a
virtually unlimited capacity. You point it at a function which returns
a string appropriate to the index number (which can be created on the
fly if need be)

Tony Bryer

Re:D3 TListBox Items limit?


Rick,
 32K of data.
 --- x
==============================
Xavier Pacheco (TeamB)
xav...@xapware.com

Sorry but TeamB cannot answer support
questions received via email.

Re:D3 TListBox Items limit?


On Fri, 05 Jun 1998 13:13:52 GMT, xav...@xapware.com (Xavier Pacheco

Quote
(TeamB)) wrote:
> 32K of data.

Yep, here's a sample program which demonstrates the general concept:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    ListBox1: TListBox;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    procedure FillListBox(ALength: Integer; ALabel: TLabel);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FillListBox(ALength: Integer; ALabel: TLabel);
const
  Msg = '{*word*99}ped out at Count: %d, with Length: %d';
var
  S : string;
  Done : Boolean;
begin

  { Inefficient, but who cares }
  S := '';
  repeat
    S := S + '*';
  until Length(S) = ALength;

  Done := False;
  ListBox1.Clear;
  ListBox1.Items.BeginUpdate;

  repeat
    try
      ListBox1.Items.Add(S);
    except
      Done := True;
      ALabel.Caption := Format(Msg, [ListBox1.Items.Count, ALength]);
    end;
  until Done;

  ListBox1.Items.EndUpdate;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  FillListBox(1, Label1);
  FillListBox(1024, Label2);
end;

end.

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Re:D3 TListBox Items limit?


In article <3577edf1.6163...@forums.borland.com>, xav...@xapware.com
says...

Hi,

Thanks for the clarification about 32K of data. And, Rick, thanks for the
demo program.

Your program {*word*99}ped out at Count 32767 (K of data) with a string length
of 1. And 16,000 or so with a string length of 1024. I ran it with a
string length of 24, which is about what the strings are in my file, and
the Count was 32767.

Perhaps I am missing something here, but it would seem that my "INI"
file, which has about 1058 lines and 18.3K of data, with each line being
about 25 characters, would not reach the ListBox limit.

Thanks for any further help.

Quote
> Rick,
>  32K of data.
>  --- x
> ==============================
> Xavier Pacheco (TeamB)

Re:D3 TListBox Items limit?


On Fri, 5 Jun 1998 10:35:20 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
wrote:

Quote
> with each line being about 25 characters, would not reach the
> ListBox limit.

You aren't taking into account the overhead which Windows itself
incurs.

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Re:D3 TListBox Items limit?


In article <3578380c.7254...@forums.borland.com>, r...@fenestra.com
says...

Quote
> On Fri, 5 Jun 1998 10:35:20 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
> wrote:

> > with each line being about 25 characters, would not reach the
> > ListBox limit.

> You aren't taking into account the overhead which Windows itself
> incurs.

Hmm, so it seems that I am indeed running into the Listbox's limit.

Time to look at one of those larger listboxes, I guess.

Thank you.

Re:D3 TListBox Items limit?


On Fri, 5 Jun 1998 12:32:33 -0700, kenNOh...@dcalcodaNO.com (Ken Hale)
wrote:

Quote
> Time to look at one of those larger listboxes, I guess.

Or you can use a TDrawGrid. You can make it look pretty much like a
list box.

--
Rick Rogers (TeamB) | Fenestra Technologies
http://www.fenestra.com/

Other Threads