Recent

Author Topic: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi  (Read 606 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1109
    • HowTos Considered Harmful?
Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
Lazarus 3.0/FPC 3.2.2

jamie

  • Hero Member
  • *****
  • Posts: 6579
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #1 on: September 08, 2024, 11:18:45 pm »
Assuming that you asked that, I would guess you are having problems?

are you having linking issues or reading controls from the resource issues?

There is a limit to everything except for your taxes going up.
The only true wisdom is knowing you know nothing

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1408
    • Lebeau Software
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #2 on: September 09, 2024, 01:53:49 am »
Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi

No, there is not.  LFM and DFM are streaming formats, so they can be as large as they need to be.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

Bart

  • Hero Member
  • *****
  • Posts: 5364
    • Bart en Mariska's Webstek
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #3 on: September 09, 2024, 10:35:24 am »
No, there is not.  LFM and DFM are streaming formats, so they can be as large as they need to be.

Then High(SizeInt) would probably be the max.

Bart

vfclists

  • Hero Member
  • *****
  • Posts: 1109
    • HowTos Considered Harmful?
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #4 on: September 09, 2024, 01:55:00 pm »
Is the absence of limit due to the fact of .lfm and .dfm files being means of streaming data?

I would assume there is a limit to the amount components a form holds.
Lazarus 3.0/FPC 3.2.2

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10309
  • Debugger - SynEdit - and more
    • wiki
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #5 on: September 09, 2024, 02:18:31 pm »
I guess it depends what answer you seek, and there may not be a simple or universal answer.

The limit for the lfm is afaik set by:
- What can the IDE handle: high(integer)?,  memory available (e.g. 32 bit IDE, single biggest avail chunk of mem)
- How slow can the designer go before you get bothered
- What can the resource compiler take (to compile to the binary resource), probably high(integer) again.
...

Then what can be put into an executable: elf, PE, ... maximum resource size (single resource/all resources)
And in reverse the code loading your form, what can it take => probably high(integer). And how much time can it spent to load your form. And does it get enough memory.

If the size matters, because you want to fill your form with huge amount of TWinControls  (rather than embedding a 8k image list into your form lfm) then you may hit limits with the OS/WS.
But that wouldn't be a limit of the lfm. If you have a form, and you have code that creates 10000 TButtons => that may be an issue for most/any OS???




For all else, it seems there aren't any intentional limits, such as the IDE checking for some limit set in the IDE. The limits, if any are inherited from hardware and other tools. And where/if they have there limits... Well that seems to be less well known. (And in parts is not about the lfm itself)

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1408
    • Lebeau Software
Re: Is there a maximum length for the .lfm and dfm files in Lazarus and Delphi
« Reply #6 on: September 09, 2024, 07:35:30 pm »
I would assume there is a limit to the amount components a form holds.

Yes, of course, there is a max limit to any list in memory, and a Form has to keep track of the components it holds.  But realistically, that number is quite high, so the effective limit is going to be available memory.

But, the limit on how many components an LFM/DMF can hold is going to be limited by whatever storage the LFM/DFM is held in (ie, a file on disk, a resource in the EXE, etc).  Again, not a limit imposed by the LFM/DFM format itself.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

 

TinyPortal © 2005-2018