Recent

Author Topic: FreePascal/Lazarus documentation  (Read 1912 times)

fxeconomist

  • Jr. Member
  • **
  • Posts: 67
FreePascal/Lazarus documentation
« on: March 04, 2026, 06:42:30 pm »
I miss the old programming so much.

I remember when I was a kid, Borland Pascal 7 had all it needed. With one Turbo Pascal programming book in Romanian, and with the ginormous help file BP had, everyone was there. Nothing was missing. You want graphics - you look at Graph unit. You want file operations - you look at Dos unit. And so on.

I'm just gonna skip the BPW. I wasn't ready at the time to understand hwnds and device contexts and message loops and all of that.

After the transition to .Net - which I missed at that time - we got into magical coding. So instead of the beautiful coding we had, it all turned into a form of wizardry where you dig in for hours thru the classes and methods to write a few lines, like finding the right spell in a grimoire. That's when I kinda lost connection to regular coding before moving into Metatrader/MQL4 for some years.

Is there any full documentation for Lazarus, just as BP7 had ?

I mean how the hell would I know that it has an UINT32 and an UINT64 since I knew these are C things ? Our world knew only Longint and the deceased Comp.

I was just trying yesterday to test CopyFile in FreePascal and it even fails with compilation errorc : illegal expression at 1329 in lazfileutils.pas cause it can't do Param+:=Params[p] -> although it's the same 3.2.2 and I tried with {$mode objfpc} as well.

I moved the test to Lazarus where it compiled, I don't understand why and I don't need to. But why do I need to google everything ?

Is there really no full reference for the units and the classes ? How can i possibly know that it can copy a file and even make the directory structure in the meanwhile if there is no manual about it ? Marco Cantu wrote a 500-page book about Delphi 11 Alexandria without even touching stuff that's in units!

Is there really no full documentation, top to bottom, including the units and various useful packages like RichMemo for instance, something that can be navigated fully offline ?



« Last Edit: March 04, 2026, 06:52:18 pm by fxeconomist »

LemonParty

  • Sr. Member
  • ****
  • Posts: 464
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

fxeconomist

  • Jr. Member
  • **
  • Posts: 67
Re: FreePascal/Lazarus documentation
« Reply #2 on: March 04, 2026, 07:58:09 pm »
Have you seen this things?
https://www.freepascal.org/down/docs/docs-hungary.var
https://download.lazarus-ide.org/Lazarus%20Documentation/

Give you an example. I worked these days with CopyFile and TRichMemo. I opened all chm files. Searched for these. No topic found.
I opened the html then. Searched all htm and html files for any reference. Zip. Nada.

But the place where I find information constantly is the wiki. Maybe I should scrape the website entirely time totime.

dsiders

  • Hero Member
  • *****
  • Posts: 1612
Re: FreePascal/Lazarus documentation
« Reply #3 on: March 04, 2026, 08:58:58 pm »
Have you seen this things?
https://www.freepascal.org/down/docs/docs-hungary.var
https://download.lazarus-ide.org/Lazarus%20Documentation/

Give you an example. I worked these days with CopyFile and TRichMemo. I opened all chm files. Searched for these. No topic found.
I opened the html then. Searched all htm and html files for any reference. Zip. Nada.

But the place where I find information constantly is the wiki. Maybe I should scrape the website entirely time totime.

For starters, TRichMemo is a third-party component. So Lazarus will not provide docs for it - that project would have to provide it. And even if they do, you can't integrate that CHM into the IDE help system. HTML yes... CHM no.

For CopyFile, that's part of the Windows RTL. When I look at the source XML files, there is no topic for CopyFile.
« Last Edit: March 04, 2026, 09:11:21 pm by dsiders »

LemonParty

  • Sr. Member
  • ****
  • Posts: 464
Re: FreePascal/Lazarus documentation
« Reply #4 on: March 04, 2026, 09:04:46 pm »
By the way, is it possible to edit the official documentation or it is only can be done by compiler developers?
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11

dsiders

  • Hero Member
  • *****
  • Posts: 1612
Re: FreePascal/Lazarus documentation
« Reply #5 on: March 04, 2026, 09:06:58 pm »
By the way, is it possible to edit the official documentation or it is only can be done by compiler developers?

You can post requests or patches to the respective bug trackers for both projects.

n7800

  • Hero Member
  • *****
  • Posts: 691
  • Lazarus IDE contributor
    • GitLab profile
Re: FreePascal/Lazarus documentation
« Reply #6 on: March 04, 2026, 09:16:39 pm »
I remember when I was a kid, Borland Pascal 7 had all it needed. With one Turbo Pascal programming book in Romanian, and with the ginormous help file BP had, everyone was there. Nothing was missing. You want graphics - you look at Graph unit. You want file operations - you look at Dos unit. And so on.

There are so many different things: the FPC compiler, the standard RTL library, the FCL and other FPC packages, the LCL component library, standard Lazarus packages, and many other packages from various authors...

All of this can't be contained in one book, either in terms of size or scope. Therefore, documentation isn't lacking - on the contrary, it's abundant ))

n7800

  • Hero Member
  • *****
  • Posts: 691
  • Lazarus IDE contributor
    • GitLab profile
Re: FreePascal/Lazarus documentation
« Reply #7 on: March 04, 2026, 09:16:51 pm »
But why do I need to google everything ?

Because that's the fate of all programmers ))

Even if there were a completely complete and up-to-date book, it would still be out of date because development continues - bugs are fixed, new features are added. So when should a new book be written?

That's why there are many books about Lazarus, from different years and with different content. You can support their authors by purchasing it.

n7800

  • Hero Member
  • *****
  • Posts: 691
  • Lazarus IDE contributor
    • GitLab profile
Re: FreePascal/Lazarus documentation
« Reply #8 on: March 04, 2026, 09:18:37 pm »
By the way, is it possible to edit the official documentation or it is only can be done by compiler developers?

You can post requests or patches to the respective bug trackers for both projects.

Some links:
* FPC: https://gitlab.com/freepascal.org/fpc/documentation/-/issues
* Lazarus: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues

fxeconomist

  • Jr. Member
  • **
  • Posts: 67
Re: FreePascal/Lazarus documentation
« Reply #9 on: March 04, 2026, 09:53:56 pm »
Have you seen this things?
https://www.freepascal.org/down/docs/docs-hungary.var
https://download.lazarus-ide.org/Lazarus%20Documentation/

Give you an example. I worked these days with CopyFile and TRichMemo. I opened all chm files. Searched for these. No topic found.
I opened the html then. Searched all htm and html files for any reference. Zip. Nada.

But the place where I find information constantly is the wiki. Maybe I should scrape the website entirely time totime.

For starters, TRichMemo is a third-party component. So Lazarus will not provide docs for it - that project would have to provide it. And even if they do, you can't integrate that CHM into the IDE help system. HTML yes... CHM no.

For CopyFile, that's part of the Windows RTL. When I look at the source XML files, there is no topic for CopyFile.

In time, I managed to get rid of the need for contextual help as in the days of yore. But there has to be some documentation for 3rd party components, cause... that's why they are included, right ? To be used.

I found CopyFile in the wiki and then in the inc file, somewhere around the lazutils. I remember the old times: everything was either in BPW.HLP or in that Win32 Programmer's Reference, which I still have to this day.

dsiders

  • Hero Member
  • *****
  • Posts: 1612
Re: FreePascal/Lazarus documentation
« Reply #10 on: March 04, 2026, 10:13:54 pm »
But there has to be some documentation for 3rd party components, cause... that's why they are included, right ? To be used.

To be fair, being included on OPM is not included in the base product. Do they provide any help in the downloaded RichMemo package?

I found CopyFile in the wiki and then in the inc file, somewhere around the lazutils. I remember the old times: everything was either in BPW.HLP or in that Win32 Programmer's Reference, which I still have to this day.

CopyFile is a wrapper for the WinAPI routine. Use MSDN (or whatever it's called these days). Or learn how to use the ExternalHelp package to link to it.



n7800

  • Hero Member
  • *****
  • Posts: 691
  • Lazarus IDE contributor
    • GitLab profile
Re: FreePascal/Lazarus documentation
« Reply #11 on: March 04, 2026, 10:54:50 pm »
But there has to be some documentation for 3rd party components, cause... that's why they are included, right ? To be used.

That's why they're called third-party software - that's the job of their authors. Admit it, do you write documentation for your own programs? Even if the answer is "yes", that's not the case for most people. Almost all programmers want to write code and see the results of their program, not write documentation that "almost no one reads".

eny

  • Hero Member
  • *****
  • Posts: 1665
Re: FreePascal/Lazarus documentation
« Reply #12 on: March 05, 2026, 12:57:10 am »
After the transition to .Net - which I missed at that time - we got into magical coding. So instead of the beautiful coding we had, it all turned into a form of wizardry where you dig in for hours thru the classes and methods to write a few lines, like finding the right spell in a grimoire....
Yeah, I feel your pain.
I remember buying a book once called 'Teach yourself Windows 95 programming in 21 days.'.
1100+ pages of complex spells, magical tokens and special ingredients to get a button on screen that changes color when you hover a mouse over it...

However the development paradigm has shifted quite a lot since those early days.
And Lazarus/FPC do quite a good job of offering a comprehensive toolkit that covers many development needs out of the box.
The little caveat is that from what I read here, in general, many ppl come from a Delphi background (myself included).
And that makes picking up Lazarus quite easy.

The issue for a novice/advanced beginner is that after the real basics, it's hard to find useful information to get to the next level.
A lot is written, but there is not a lot of useful documentation that explains how things are supposed to be used.
A dump of a class with it's methods is not documentation...
Unfortunately with Lazarus, c'est la vie. Lazarus is not Python or Java, for which you can find thousands of 'tutorials', about any subject, on line.

3rd party components is one of the areas where Lazarus is seriously lacking, compared to e.g. Python.
There are a lot of components that are quite useful, but often documentation is lacking. Or if you step off the yellow brick road, things start breaking.

Having said that, Google (or ChatGPT, nowadays) is your friend in many cases and the Wiki is quite a good source of information, with lots of examples.
The question you should probably ask is, in what area you encounter the most difficulties? Because Lazarus development is not BP7 development.

My 2 cents of advice, when you get stuck somewhere, just ask the question here on the forum.
Big chance someone will have the answer for you or can push you in the right direction.
Oh, and stick to the stable releases, far away from the development branches  :D
All posts based on: Win11; stable Lazarus 4_4  (x64) 2026-02-12 (unless specified otherwise...)

dbannon

  • Hero Member
  • *****
  • Posts: 3805
    • tomboy-ng, a rewrite of the classic Tomboy
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

wp

  • Hero Member
  • *****
  • Posts: 13512
Re: FreePascal/Lazarus documentation
« Reply #14 on: March 05, 2026, 01:28:16 am »
As others already said documentation often is not complete. Therefore, it is extremely important that you learn how to navigate in the source file and find the sources for which you want to learn more.

Example: How to find the sources of TRichMemo?
- Drop a TRichMemo on your form.
- In the form's interface part you'll find the line "RichMemo1: TRichMemo"
- With the CTRL-Key down left-click on the word "TRichMemo"
- The IDE will open the unit in which TRichMemo is declared, and moves the cursor to its declaration.
- Here you see all methods and properties of TRichMemo.
- If the cursor is on a method press SHIFT+CTRL UP to jump into the implementation of that specific method. Here you can see all the "magic details" of the code.
- Many more methods and properties are introduced by its ancestor, TCustomRichMemo.
- To get there, do the same: CTRL+left click on "TCustomRichMemo" - the IDE will show your the interface of TCustomRichMemo
- You can do this with any identifier!

 

TinyPortal © 2005-2018