Re: [fpc-pascal] Compilation raised exception internally

2025-04-25 Thread Michael Van Canneyt via fpc-pascal
On Fri, 25 Apr 2025, Luca Olivetti via fpc-pascal wrote: Hello, recently I get a lot of these errors (i.e., I modify something, in lazarus click on "compile" or "run", and I get the error). If I then use "clean up & build.." the compilation ends without errors. I recently switched the virt

Re: [fpc-pascal] sqldb, copy table between databases is painfully slow

2025-02-18 Thread Michael Van Canneyt via fpc-pascal
On Tue, 18 Feb 2025, Luca Olivetti via fpc-pascal wrote: Hello, I need to copy a table between an mssql database and a postgresql one. I used a query to obtain the data, a datasource ponting to it and another query using the datasource, the sql being INSERT INTO table (f1,f2,f3...) value

Re: [fpc-pascal] gmp

2025-02-17 Thread Michael Van Canneyt via fpc-pascal
On Fri, 14 Feb 2025, ppadilcdx--- via fpc-pascal wrote: I did copy gmp.pas to another folder and named it mygmp.pas, changed "$linklib gmp.3” to "$linklib gmp.dylib” (just plain gmp did not work). Now examples compile and run with the change to “uses mygmp” and adding opt/homebrew/lib to the

Re: [fpc-pascal] gmp

2025-02-14 Thread Michael Van Canneyt via fpc-pascal
On Tue, 11 Feb 2025, ppadilcdx--- via fpc-pascal wrote: What else do I need to add to the compile line to use the gmp unit? I added gmp to the use line and it throws an error in compilation: ld: warning: -multiply_defined is obsolete -macosx_version_min has been renamed to -macos_version_mi

Re: [fpc-pascal] fcl-stl docs and examples

2025-02-04 Thread Michael Van Canneyt via fpc-pascal
On Mon, 3 Feb 2025, ppadilcdx--- via fpc-pascal wrote: Is there a reason that the fpc installation does not include the fcl-stl examples and docs in the share/doc directory? I had to download the fpc source to find them (in packages/fcl-stl). No, it is an oversight. Michael.

Re: [fpc-pascal] Compile errors

2025-01-24 Thread Michael Van Canneyt via fpc-pascal
On Thu, 23 Jan 2025, Frank McCormick via fpc-pascal wrote: Strange. I know someone who uses ocrt on OpenSuse since years. Maybe he is still on an older version of OpenSuse. I now tested 10 of the provided demos and on my linux mint they all start without problem. This is weird. This

Re: [fpc-pascal] Compile errors

2025-01-21 Thread Michael Van Canneyt via fpc-pascal
On Tue, 21 Jan 2025, Frank McCormick via fpc-pascal wrote: On 2025-01-21 09:00, Michael Van Canneyt via fpc-pascal wrote: On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: I have been trying out a CRT replacement called NCRT and OCRT and am getting link errors which I can&#

Re: [fpc-pascal] Compile errors

2025-01-21 Thread Michael Van Canneyt via fpc-pascal
On Mon, 20 Jan 2025, Frank McCormick via fpc-pascal wrote: I have been trying out a CRT replacement called NCRT and OCRT and am getting link errors which I can't track down. Originally I was getting compile errors but I sorted that out. Are these units still workable with Free Pascal ? Thes

Re: [fpc-pascal] unixsockets

2025-01-03 Thread Michael Van Canneyt via fpc-pascal
On Sat, 28 Dec 2024, Andrew Haines via fpc-pascal wrote: Hi, is unixsockets.pp in rtl-extra supposed to be included when fpc is built for linux? I ran Yes. It was not built, I added it to fpmake. I also applied the fix you mentioned for the size_t problem. Michael. ___

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread Michael Van Canneyt via fpc-pascal
On Fri, 20 Dec 2024, Karoly Balogh via fpc-pascal wrote: Hi, On Fri, 20 Dec 2024, Michael Van Canneyt via fpc-pascal wrote: If I compile it with: Free Pascal Compiler version 3.3.1-16969-g798f2ba632-dirty [2024/11/28] for i386 I get almost what I expected, but my #$EE is now been changed

Re: [fpc-pascal] Is there a recent change to TProcess?

2024-12-20 Thread Michael Van Canneyt via fpc-pascal
On Thu, 19 Dec 2024, James Richters via fpc-pascal wrote: I am using ProgProcess to execute a program with data passed as parameters. I'm adding the parameters with this: ProgProcess := TProcess.Create(nil); ProgProcess.Executable := 'cmd.exe'; ProgProcess.Parameters.

Re: [fpc-pascal] How to compile program from command line on Linux?

2024-12-16 Thread Michael Van Canneyt via fpc-pascal
On Mon, 16 Dec 2024, Bo Berglund via fpc-pascal wrote: I have written a command line utility program on Linux using Lazarus as the IDE. This was done a while ago on an Ubuntu Desktop 20.04 machine, which I normally access using VNC when doing Lazarus work there. Now since a few months the Ti

Re: [fpc-pascal] Procedural parameters

2024-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sun, 15 Dec 2024, Sven Barth via fpc-pascal wrote: Which I paraphrased loosely as: "It's not because something is in the pascal standard, that FPC has it." As with any of the language dialect compatibility modes the point is that FPC can compile code in that dialect, but *not* that cod

Re: [fpc-pascal] Procedural parameters

2024-12-15 Thread Michael Van Canneyt via fpc-pascal
On Sun, 15 Dec 2024, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: On Sat, 14 Dec 2024, Adriaan van Os via fpc-pascal wrote: It's not because something is in the pascal standard, that FPC has it. It is. Appendix D6 of the Programmer's Refe

Re: [fpc-pascal] Procedural parameters

2024-12-15 Thread Michael Van Canneyt via fpc-pascal
On Sat, 14 Dec 2024, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: On Sat, 14 Dec 2024, Adriaan van Os via fpc-pascal wrote: Macpascal and Iso pascal have procedural parameters, e.g. function A( function B: double): double; Is there a $modeswitch

Re: [fpc-pascal] Procedural parameters

2024-12-14 Thread Michael Van Canneyt via fpc-pascal
On Sat, 14 Dec 2024, Adriaan van Os via fpc-pascal wrote: Macpascal and Iso pascal have procedural parameters, e.g. function A( function B: double): double; Is there a $modeswitch to allow this ? I searched "procedure parameter" and "procedural parameter" in the Language Reference

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Michael Van Canneyt via fpc-pascal
On Wed, 4 Dec 2024, Sven Barth via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal schrieb am Mi., 4. Dez. 2024, 18:24: @Michael: do you think you can take a look? I also got the feeling that it tries to compile more while nothing changed than with 3.2.2, though I did not yet

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Michael Van Canneyt via fpc-pascal
On Wed, 4 Dec 2024, Sven Barth via fpc-pascal wrote: Hairy Pixels via fpc-pascal schrieb am Mi., 4. Dez. 2024, 13:56: Were there known changes in that area since March 3rd 2023? Honestly they were causing so many crashes maybe they got pulled for incremental building. I’d rather take the cr

Re: [fpc-pascal] What to do to get new users

2024-12-01 Thread Michael Van Canneyt via fpc-pascal
On Sun, 1 Dec 2024, Hairy Pixels via fpc-pascal wrote: On Nov 30, 2024 at 11:54:21 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: sorry but it’s not really part of the compiler, just something that generates commands it feeds to the compile right?.

Re: [fpc-pascal] What to do to get new users

2024-11-30 Thread Michael Van Canneyt via fpc-pascal
On Sat, 30 Nov 2024, Hairy Pixels via fpc-pascal wrote: On Nov 30, 2024 at 3:11:10 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: This is very much on topic. FPC has no build system Huh ? Of course it does, it has 2. fpcmake (older) and fpmake.

Re: [fpc-pascal] What to do to get new users

2024-11-30 Thread Michael Van Canneyt via fpc-pascal
On Fri, 29 Nov 2024, Hairy Pixels via fpc-pascal wrote: On Nov 29, 2024 at 8:11:11 AM, James Richters via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: I'm intrigued by FPGUI, I'm trying to build FPGUI on Windows 10, and I'm having some difficulty. When I follow the instructions from

Re: [fpc-pascal] What to do to get new users

2024-11-24 Thread Michael Van Canneyt via fpc-pascal
On Sat, 23 Nov 2024, Hairy Pixels via fpc-pascal wrote: On Nov 24, 2024 at 4:12:03 AM, Iwan Kelaiah via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Hello, I'm not sure, but I am working on this one: https://ikelaiah.github.io/free-pascal-cookbook/, and it mentions how to install FP

Re: [fpc-pascal] What to do to get new users

2024-11-18 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Nov 2024, Vern via fpc-pascal wrote: Travis, There is a discussion in the fpc archives 2014 I believe about using Geany. I have been using Geany for over 10 years with complex GUI programs ... but you must use a file located in the directory where the executable is linked. ...

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Nov 2024, Marcos Douglas B. Santos via fpc-pascal wrote: On Sat, Nov 16, 2024 at 11:43 AM Michael Van Canneyt via fpc-pascal wrote: > I could see that if it was a compiler for “Pascal” which was defined by > some other group and you could reference them but it isn’t. FP

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Nov 2024, Hairy Pixels via fpc-pascal wrote: On Nov 16, 2024 at 7:24:01 PM, Michael Van Canneyt wrote: That said, the Free Pascal website is not about the pascal language. It is about the compiler. The GNU compiler or LLVM C compiler also do not contain code on their website. No

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Nov 2024, Hairy Pixels via fpc-pascal wrote: On Nov 16, 2024 at 3:13:26 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: If you know nothing about the language, the main page explains to you quickly what's the point of the language, and gives you exampl

Re: [fpc-pascal] docs

2024-10-21 Thread Michael Van Canneyt via fpc-pascal
On Sun, 20 Oct 2024, ppadilcdx--- via fpc-pascal wrote: Apropos the new users discussion, i think the state of the docs is really important, new users can be discouraged by lack of documentation or up-to-date docs. I just recently retired so not a new young user, but relatily new to fpc. So

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Michael Van Canneyt via fpc-pascal
On Fri, 18 Oct 2024, Hairy Pixels via fpc-pascal wrote: On Oct 19, 2024 at 2:31:36 AM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: This would mean that a new class type or some kind of additional attribute would have to be introduced which would have to be incompatibl

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-18 Thread Michael Van Canneyt via fpc-pascal
On Fri, 18 Oct 2024, Martin Frb via fpc-pascal wrote: On 18/10/2024 10:41, Karoly Balogh via fpc-pascal wrote: For once, I'd be really glad if a bunch of the containers would be Thread-Safe by default, like TList and things, and they aren't, because they're based on almost 3 decade old Delph

Re: [fpc-pascal] Funding for FOSS projects, needs funding.json file in Gitlab

2024-10-18 Thread Michael Van Canneyt via fpc-pascal
On Thu, 17 Oct 2024, Christo Crause via fpc-pascal wrote: On Wed, Oct 16, 2024 at 7:42 PM Alexey T. via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: 15 Oct news at Hacker News: https://floss.fund/blog/announcing-floss-fund/ They pay 1M $ per year, all FPC needs to apply is the fundin

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-17 Thread Michael Van Canneyt via fpc-pascal
On Thu, 17 Oct 2024, Sven Barth via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal schrieb am Do., 17. Okt. 2024, 11:40: On Wed, 16 Oct 2024, Hairy Pixels via fpc-pascal wrote: On Oct 17, 2024 at 12:03:47 AM, Guillermo Martínez Jiménez via fpc-pascal < fpc-pas

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-17 Thread Michael Van Canneyt via fpc-pascal
On Wed, 16 Oct 2024, Hairy Pixels via fpc-pascal wrote: On Oct 17, 2024 at 12:03:47 AM, Guillermo Martínez Jiménez via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Prease DON'T add garbage collector. IMO it isn't a good idea. I had very bad experiences with it. Unless somebody foun

Re: [fpc-pascal] What to do to get new users

2024-10-17 Thread Michael Van Canneyt via fpc-pascal
On Thu, 17 Oct 2024, Nikolay Nikolov via fpc-pascal wrote: I fully agree. It is especially true for young people. My wife creates websites for a living. I nearly had to re-animate her after she looked at the FPC website. The FPC website is a no-go area for her since that time. Hence my in

Re: [fpc-pascal] What to do to get new users

2024-10-17 Thread Michael Van Canneyt via fpc-pascal
On Wed, 16 Oct 2024, Hairy Pixels via fpc-pascal wrote: On Oct 17, 2024 at 4:12:08 AM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: I have proposed this to the FPC core team, after some insistance I managed to get a list of constraints from (if memory

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Michael Van Canneyt via fpc-pascal
On Wed, 16 Oct 2024, Ralf Quint via fpc-pascal wrote: Sorry, but there has been so much nonsense in this thread, I just had to add my 2c as well. On 10/15/2024 4:07 PM, Rainer Stratmann via fpc-pascal wrote: At the Lazarus Congress in Cologne in October 2024, it ended up being very interest

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Michael Van Canneyt via fpc-pascal
On Wed, 16 Oct 2024, Nikolay Nikolov via fpc-pascal wrote: On 10/16/24 4:57 PM, Hairy Pixels via fpc-pascal wrote: On Oct 16, 2024 at 8:50:21 PM, Ștefan-Iulian Alecu via fpc-pascal wrote: 4. a proper VSCode extension (we can include Vim and Emacs there too, but the main focus is VSCode) wi

Re: [fpc-pascal] JSON-Schema added

2024-08-18 Thread Michael Van Canneyt via fpc-pascal
On Sat, 17 Aug 2024, Thomas Kurz via fpc-pascal wrote: Great! Is this Json Typedef as described here? https://jsontypedef.com/ No, it is https://json-schema.org I know about jsontypedef, and it is on my todo list because personally I prefer it to json-schema which is a bit heavy-handed. (

[fpc-pascal] JSON-Schema added

2024-08-17 Thread Michael Van Canneyt via fpc-pascal
Hi, I added a JSON-Schema class to FPC. It currently supports the latest JSON-Schema draft (2020-12) There also is a validator class. There is a testsuite, but testsuites only go so far, so I'd appreciate some feedback from people who have need for JSON-schema. (in particular, the $ref handl

Re: [fpc-pascal] [Fpc-mirrors] FPC 3.2.2, miért nincs tovább fejlesztve ...

2024-08-13 Thread Michael Van Canneyt via fpc-pascal
Hungarian: -- Legyen szíves angolul írni. A levelezőlista nyelve angol. Valószínűleg csak néhány ember van itt, aki ért magyarul. Valószínűleg a többiek is szeretnék érteni, amit írsz. (a "Google fordító" segítségével fordítva) Köszönöm. English: Please have the courte

[fpc-pascal] MacOS Developer wanted

2024-08-12 Thread Michael Van Canneyt via fpc-pascal
Hello, I was contacted by a company called Image-line: http://www.image-line.com/ They develop software using FPC and are looking for FPC developers, who can take on the following tasks: * Maintain macOS build tools (Free Pascal and Xcode). * Create and maintain build server jobs. * Set up

Re: [fpc-pascal] Documentation typo?

2024-07-27 Thread Michael Van Canneyt via fpc-pascal
On Tue, 23 Jul 2024, Thomas Kurz via fpc-pascal wrote: Hello, in `https://www.freepascal.org/docs-html/current/rtl/sockets/netaddrtostr6.html`, it is written: NetAddrToStr6 converts the IPV6 network address in Entry to a string representation in human-readable form. Basically, it is th

Re: [fpc-pascal] Sub-millisecond time measuring

2024-07-01 Thread Michael Van Canneyt via fpc-pascal
On Mon, 1 Jul 2024, Sven Barth via fpc-pascal wrote: Adriaan van Os via fpc-pascal schrieb am Sa., 29. Juni 2024, 21:21: Michael Van Canneyt via fpc-pascal wrote: Is that a function in the RTL? I can't find it. No, these are platform-specific functions. g_get_monotonic_ti

Re: [fpc-pascal] Sub-millisecond time measuring

2024-06-29 Thread Michael Van Canneyt via fpc-pascal
On Sat, 29 Jun 2024, Hairy Pixels via fpc-pascal wrote: On Jun 29, 2024, at 5:43 PM, Adriaan van Os wrote: Hairy Pixels via fpc-pascal wrote: I had a large function which I was profiling with MilliSecondsBetween but I split it to be called many different times and now it's not accumulat

Re: [fpc-pascal] FPC 3.3.x breaks the Firebird Project's Firebird.pas

2024-06-18 Thread Michael Van Canneyt via fpc-pascal
On Tue, 18 Jun 2024, Benito van der Zander via fpc-pascal wrote: Hi, This field was introduced for Delphi compatibility: The implementation of TMonitor requires this data. Delphi has this field as well but "hides" the field behind all other actually declared fields. If you examine the

Re: [fpc-pascal] FPC 3.3.x breaks the Firebird Project's Firebird.pas

2024-05-04 Thread Michael Van Canneyt via fpc-pascal
On Sat, 4 May 2024, Tony Whyman via fpc-pascal wrote: Michael, I believe that the diplomatic answer to your response is that it is "disappointing". This is a serious problem and needs to be discussed. Thank you for being diplomatic. Interfaces between modules written in different progr

Re: [fpc-pascal] FPC 3.3.x breaks the Firebird Project's Firebird.pas

2024-05-02 Thread Michael Van Canneyt via fpc-pascal
On Thu, 2 May 2024, Tony Whyman via fpc-pascal wrote: This is a problem reported to me by an IBX user. I have not yet confirmed it (need to find the time to set up the latest development branch of FPC), but the issue looks solid, and is due to the following addition to TObject (copied from

Re: [fpc-pascal] AnsiString address changed

2024-03-18 Thread Michael Van Canneyt via fpc-pascal
On Mon, 18 Mar 2024, Hairy Pixels via fpc-pascal wrote: On Mar 18, 2024, at 3:27 PM, Hairy Pixels wrote: Oh, it's a pointer to a pointer? I guess that explains how it can resize itself and not invalidate shared references, if those are even possible with AnsiString. Wait, that's total

Re: [fpc-pascal] AnsiString address changed

2024-03-17 Thread Michael Van Canneyt via fpc-pascal
On Mon, 18 Mar 2024, Hairy Pixels via fpc-pascal wrote: Curious, why did the address of "s" change here? Shouldn't the AnsiString be incrementing a reference count and not actually changing the actual pointer or copying? Correct me if I'm wrong, AnsiString is ref counted when passing in/ou

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Michael Van Canneyt via fpc-pascal
On Thu, 14 Mar 2024, Florian Klämpfl via fpc-pascal wrote: Still, it is more logical to place it under utils, with the rest of the programs. The argument about the time to compile seems simply false to me: If you consider the FPC toplevel 'make all' as the only command to issue, then you may

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Michael Van Canneyt via fpc-pascal
On Thu, 14 Mar 2024, Tomas Hajny via fpc-pascal wrote: On 2024-03-14 11:06, Marco van de Voort via fpc-pascal wrote: Op 14-3-2024 om 11:04 schreef Michael Van Canneyt via fpc-pascal: To me it therefore seems a better idea to move the IDE to utils, and to have a toplevel make command

Re: [fpc-pascal] FP IDE sources

2024-03-14 Thread Michael Van Canneyt via fpc-pascal
On Thu, 14 Mar 2024, Karoly Balogh via fpc-pascal wrote: Hi, On Thu, 14 Mar 2024, Guillermo Martínez Jiménez via fpc-pascal wrote: I thought "packages" were libraries not applications, as there is an "utils" directory with programs. I agree, I'm also not very fond of the IDE being in pack

Re: [fpc-pascal] [fcl-web] [jsonrpc] [fpjsonrpc.pp] DoCheckParamArray in TCustomJSONRPCHandler

2024-02-22 Thread Michael Van Canneyt via fpc-pascal
On Thu, 22 Feb 2024, Michael Anochin via fpc-pascal wrote: Hello, the TCustomJSONRPCHandler.DoCheckParamArray in fpjsonrpc.pp causes an exception with the message "List index (0) out of bounds". This happens, for example, if ParamArray is empty and there are not required parameter in ParamD

Re: [fpc-pascal] Floating point question

2024-02-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 18 Feb 2024, James Richters via fpc-pascal wrote: And if you have set the precision, then the calculation will be identical to the calculation when you use a variable of the same type (if not, it's indeed a bug). This is what I have been trying to point out. Math with identical c

Re: [fpc-pascal] Floating point question

2024-02-17 Thread Michael Van Canneyt via fpc-pascal
On Sat, 17 Feb 2024, wkitty42--- via fpc-pascal wrote: On 2/16/24 9:57 AM, James Richters via fpc-pascal wrote: So you are saying when constant propagation is on, an expression should have a different result than with constant propagation off? The result of math when using constants MUST b

Re: [fpc-pascal] FPReport: Split text across two or more pages

2024-02-16 Thread Michael Van Canneyt via fpc-pascal
On Fri, 16 Feb 2024, Pique7 via fpc-pascal wrote: On Mon, 8 Jan 2024 22:08:16 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: On Mon, 8 Jan 2024, Pique7 via fpc-pascal wrote: Disregarding the RTF for a moment, you'd need to save the contents of the text fields in a TStrin

Re: [fpc-pascal] Floating point question

2024-02-13 Thread Michael Van Canneyt via fpc-pascal
On Tue, 13 Feb 2024, James Richters via fpc-pascal wrote: Sorry for the kind of duplicate post, I submitted it yesterday morning and I thought it failed, so I re-did it and tried again.. then after that the original one showed up. A thought occurred to me. Since the complier math is expect

Re: [fpc-pascal] Floating point question

2024-02-12 Thread Michael Van Canneyt via fpc-pascal
On Mon, 12 Feb 2024, Thomas Kurz via fpc-pascal wrote: I wouldn't say so. Or at least, not generally. Why can't the compiler do what the programer intends to do: var s: single; d: double; e: extended; begin s := 8427.0 + 33.0 / 1440.0; // treat all constants all "single" d := 8427.0 +

Re: [fpc-pascal] Read Field names from VMT

2024-02-01 Thread Michael Van Canneyt via fpc-pascal
On Wed, 31 Jan 2024, Amir--- via fpc-pascal wrote: Without more info (declaration of ChildTClass, declaration of the constructor of that class etc), it is not possible to comment. We need a complete compilable code sample to provide you with more insight. Please have a look at the attach

Re: [fpc-pascal] Read Field names from VMT

2024-01-30 Thread Michael Van Canneyt via fpc-pascal
On Mon, 29 Jan 2024, Amir--- via fpc-pascal wrote: I am still struggling with this! for i := 0 to vft^.Count - 1 do begin    vfe := vft^.Field[i];    Name := vfe^.Name;    ChildTClass := vft^.ClassTab^.ClassRef[vfe^.TypeIndex - 1]^;    ChildObj := ChildTClass.Create;    T

Re: [fpc-pascal] Read Field names from VMT

2024-01-22 Thread Michael Van Canneyt via fpc-pascal
On Mon, 22 Jan 2024, Amir--- via fpc-pascal wrote:   Params := TParams.Create;   WriteLn(Params.Int2.IntVal);   WriteLn(TInteger(Params.FieldAddress('Int2')).IntVal); The third line does not work (the zipped code is attached). It should be WriteLn(TInteger(Params.FieldAddress('Int2')^).Int

Re: [fpc-pascal] Read Field names from VMT

2024-01-21 Thread Michael Van Canneyt via fpc-pascal
On Sun, 21 Jan 2024, Amir--- via fpc-pascal wrote: How can I set the value? I tried something like Test := TTest.Create Ptr := Pointer(Test); TSub(Ptr+8) := TSub.Create; But it is not working? Depending on your platform, it can be an alignment issue. Use function TObject.FieldAddress(c

Re: [fpc-pascal] IntToStr implementation

2024-01-18 Thread Michael Van Canneyt via fpc-pascal
On Thu, 18 Jan 2024, Adriaan van Os via fpc-pascal wrote: Also something which cannot be handled by 'standard' syntax. (unless you wish to count generics and implicit specialization as "standard syntax") actual-parameter = expression { ":" expression } . actual-parameter-list = "(" actu

Re: [fpc-pascal] IntToStr implementation

2024-01-18 Thread Michael Van Canneyt via fpc-pascal
On Thu, 18 Jan 2024, Hairy Pixels via fpc-pascal wrote: On Jan 18, 2024, at 1:51 PM, Sven Barth via fpc-pascal wrote: There is no source for Str() in that sense, because Str() is a compiler intrinsic implemented in the compiler's ninl.pas. Well that explains everything now! What is t

Re: [fpc-pascal] Trash variables (-gt) - Translation

2024-01-17 Thread Michael Van Canneyt via fpc-pascal
On Thu, 18 Jan 2024, LacaK via fpc-pascal wrote: Hi *, I am translating "Trash variables" (from English to Slovak), but I can not find appropriate words. That's why I want to describe it in more words. Is this correct: "Initialize local variables with random values" ? Or better suggestion?

Re: [fpc-pascal] Extra linkxxx.res files left over when compiling/building project

2024-01-15 Thread Michael Van Canneyt via fpc-pascal
On Mon, 15 Jan 2024, Bo Berglund via fpc-pascal wrote: I have been working on troubleshooting a command line FreePascal project for a couple of weeks now and when I look in the project dir it is full of link files: 2021-09-12 10:2323 900 link.res 2024-01-15 00:3023 8

Re: [fpc-pascal] "Address of" question

2024-01-14 Thread Michael Van Canneyt via fpc-pascal
On Sun, 14 Jan 2024, Hairy Pixels via fpc-pascal wrote: I just noticed it's possible to do @Byte in FPC. Are these 2 lines even different? It doesn't exactly make sense to take the address of a type identifier so I'm curious what this may mean. var b: Byte; p: PByte; begin p := @Byte(b)

Re: [fpc-pascal] Virtual methods on sealed classes

2024-01-08 Thread Michael Van Canneyt via fpc-pascal
On Tue, 9 Jan 2024, Hairy Pixels via fpc-pascal wrote: Do sealed classes actually call virtual methods statically or are they just for compiler warnings? The virtual methods are called exactly like other virtual methods. Sealed just means you cannot create a descendant class. No optimizat

Re: [fpc-pascal] FPReport: Split text across two or more pages

2024-01-08 Thread Michael Van Canneyt via fpc-pascal
On Mon, 8 Jan 2024, Pique7 via fpc-pascal wrote: Disregarding the RTF for a moment, you'd need to save the contents of the text fields in a TStringlist instance in the 'afterscroll' event of the dataset. This instance can then be used to create a data loop for a sub band (using TFPReportUser

Re: [fpc-pascal] Quiz

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Adriaan van Os via fpc-pascal wrote: Quiz. Which of below constant declarations are accepted by the compiler and what is their value ? const ki1 = + 2; ki2 = +2; +x is a unary expression. ki3

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: - FPC compiled as is: 388976 B - FPC compiled with full smartlinking: 55920 B - FPC compiled with C linkage: 388760 B - FPC compiled with full smartlinking and C linkage: 56792 B Maybe it is a good idea to add these numbers to the above W

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: Am 07.01.2024 um 10:01 schrieb Florian Klämpfl via fpc-pascal: Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal : I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer lan

Re: [fpc-pascal] RIP: Software design pioneer and Pascal creator Niklaus Wirth

2024-01-05 Thread Michael Van Canneyt via fpc-pascal
On Fri, 5 Jan 2024, Tony Whyman via fpc-pascal wrote: "Swiss computer scientist Professor Niklaus Wirth died on New Year's Day, roughly six weeks before what would have been his 90th birthday." https://www.theregister.com/2024/01/04/niklaus_wirth_obituary/?utm_source=daily&utm_medium=newsle

Re: [fpc-pascal] FPReport: Split text across two or more pages

2024-01-03 Thread Michael Van Canneyt via fpc-pascal
On Tue, 2 Jan 2024, Pique7 via fpc-pascal wrote: On Tue, 2 Jan 2024 00:02:35 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: On Mon, 1 Jan 2024, Pique7 via fpc-pascal wrote: Hello everyone, I have already asked this and related questions in the Lazarus Forum. I want to improve

Re: [fpc-pascal] FPReport: Split text across two or more pages

2024-01-01 Thread Michael Van Canneyt via fpc-pascal
On Mon, 1 Jan 2024, Pique7 via fpc-pascal wrote: Hello everyone, I have already asked this and related questions in the Lazarus Forum. I want to improve FPReport in order to use it for my project - if possible. Some features are missing for this, e.g. automatic splitting of text across two

Re: [fpc-pascal] How to avoid Copy

2024-01-01 Thread Michael Van Canneyt via fpc-pascal
On Mon, 1 Jan 2024, Hairy Pixels via fpc-pascal wrote: On Dec 30, 2023, at 3:18 PM, Michael Van Canneyt via fpc-pascal wrote: And try to avoid "for r in data" because it will create a copy for each element in the list. This seems more like bad compiler design than anything.

Re: [fpc-pascal] How to avoid Copy

2023-12-31 Thread Michael Van Canneyt via fpc-pascal
On Sun, 31 Dec 2023, Amir--- via fpc-pascal wrote: On 12/31/23 02:46, Marco van de Voort via fpc-pascal wrote: Op 31/12/2023 om 04:11 schreef Amir--- via fpc-pascal: I compiled the code with `fpc -O3 -Sd -gv -g -gl ` and ran `valgrind` on it (the output is attached). It does not look li

Re: [fpc-pascal] How to avoid Copy

2023-12-30 Thread Michael Van Canneyt via fpc-pascal
On Fri, 29 Dec 2023, Amir via fpc-pascal wrote: On Dec 29, 2023 9:50 PM, Adriaan van Os wrote: Amir--- via fpc-pascal wrote: > Hi all, > >  I have a List of record, where the record has a WideString field. >   I have some code like the following: >

Re: [fpc-pascal] Procedures that work like WRITELN()

2023-12-27 Thread Michael Van Canneyt via fpc-pascal
On Wed, 27 Dec 2023, James Richters via fpc-pascal wrote: I wanted to write what I thought should be a simple procedure, just instead of calling WRITELN() with some arguments, call WRITELOG() with the same arguments that you would use to write to a file, but my WRITELOG() procedure would writ

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-25 Thread Michael Van Canneyt via fpc-pascal
On Mon, 25 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: This is not correct either, as it suggests that ( ... ) is correct. It is not, if you use ... there must be other arguments present. That is offending the reader: "You are to stupid

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-25 Thread Michael Van Canneyt via fpc-pascal
On Sun, 24 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: I added univ and documented it. Something seems to have gone wrong with the defintion on page 212. Corrected, thanks. Having a better look, the rule defines just one parameter. So

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 24 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: The following zip file contains the updated documentation: http://downloads.freepascal.org/fpc/beta/3.2.4-rc1/docs/doc-pdf.zip Besides correcting your remarks, I did a general overhaul: - I

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt wrote: 32. Are the set operators "include", "exclude" missing in the syntax diagrams ? Is "><" missing (specifically) as set operator in the syntax diagrams ? Include/Exclude are not operators. They are procedu

Re: [fpc-pascal] More syntax questions (part 4)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0), part 4 34. Are macpas LEAVE and CYCLE statements

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: Another use of UNIV is type-compatibility of procedural parameters. For example with function BinaryFind ( theValuePtr : univ UnivPtr; theFirstIndex : Int32; theLastInd

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) part 3 26. Am I correct to assume the following equivalents for rules that I couldn't find a defin

Re: [fpc-pascal] More syntax questions (part 4)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: 37. Shouldn't the macpas "mwpascal" modifier be added to ? call-modifiers = "register" | "cdecl" | "pascal" | "stdcall" |

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: 28. The documentation for macpas "UNIV" is missing ? I have no idea what this is ? UNIV is macpas specific (as mentioned in Appendix D.6 of the Programmer's Manual) T

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Michael Van Canneyt via fpc-pascal
On Wed, 20 Dec 2023, Hairy Pixels via fpc-pascal wrote: I feel like this was addressed but I couldn't find any references. The program below prints the following: Initialize Create Finalize Finalize Why is Finalize called twice? I thought those were supposed to be called in pairs with

Re: [fpc-pascal] More syntax questions (part 4)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0), part 4 34. Are macpas LEAVE and CYCLE statements undocumented ? Yes. 35. Are macpas ellipsis (...) parameters undocumented ? Yes. 36. Is the macpas R

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Wayne Sherman wrote: On Sat, Dec 16, 2023 at 7:35 AM Michael Van Canneyt wrote: Hm. Lot of corrections to do.. I'll be busy tonight :-) Are these grammars in GIT so others can help by submitting merge requests? That way you can spread the love :-) Everything concern

Re: [fpc-pascal] More syntax questions (part 3)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) part 3 26. Am I correct to assume the following equivalents for rules that I couldn't find a definiton for: formal-parameter-list =

Re: [fpc-pascal] More syntax questions (part 2)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) part 2 17. For the following rules, I couldn't find a definition in the Language Reference. Can I assume they can all be defined as ? object-type-i

Re: [fpc-pascal] More syntax questions (and more to follow)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: Thanks for the replies. Please note that the syntax diagrams are NOT meant to be exhaustive. They are an aid to explain the syntax. I strive to make them as correct as possible, but they

Re: [fpc-pascal] More syntax questions (and more to follow)

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Adriaan van Os via fpc-pascal wrote: More questions about the FreePascal Language Reference (version 3.2.0) 1. Section 17.1 defines a rule and raise-statement = "raise" [ exception-instance [ exception-address ] ] . exception-address = "at" exception-address [ ","

Re: [fpc-pascal] case statement

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Fri, 15 Dec 2023, Adriaan van Os wrote: Michael Van Canneyt via fpc-pascal wrote: The fact that the semicolon before the else is optional ? I don't see a semicolon in the formal syntax. This works: OK, than an optional semicolon must be added to the rule exceptionhan

Re: [fpc-pascal] method-definition

2023-12-16 Thread Michael Van Canneyt via fpc-pascal
On Sat, 16 Dec 2023, Hairy Pixels via fpc-pascal wrote: On Dec 15, 2023, at 8:56 PM, Adriaan van Os via fpc-pascal wrote: What complicates things, is that many conflicting rules have the same name in the Language Reference. For example, conceptually we have object-methods, record-metho

Re: [fpc-pascal] case statement

2023-12-15 Thread Michael Van Canneyt via fpc-pascal
On Fri, 15 Dec 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: On Fri, 15 Dec 2023, Adriaan van Os via fpc-pascal wrote: Note that the same ambiguity exists in the syntax (and this is less well known) exceptionhandlers = [ exception-handler

Re: [fpc-pascal] case statement

2023-12-15 Thread Michael Van Canneyt via fpc-pascal
On Fri, 15 Dec 2023, Adriaan van Os via fpc-pascal wrote: Note that the same ambiguity exists in the syntax (and this is less well known) exceptionhandlers = [ exception-handler { ";" exception-handler } [ "ELSE" statement-list ] | statement-list ] . exception-handler = "ON" [ identifier

Re: [fpc-pascal] implementation-part

2023-12-14 Thread Michael Van Canneyt via fpc-pascal
On Fri, 15 Dec 2023, Adriaan van Os via fpc-pascal wrote: The Freepascal Language Reference (version 3.2.0) states in section 16.2 "As can be seen from the syntax diagram, a unit always consists of a interface and an implementation part." and "Both the interface part or implementation p

Re: [fpc-pascal] case statement

2023-12-14 Thread Michael Van Canneyt via fpc-pascal
On Thu, 14 Dec 2023, Adriaan van Os via fpc-pascal wrote: I am looking in detail at the syntax diagrams in the Freepascal Language Reference (version 3.2.0) Section 13.2.2 discusses the case-statement. Translated to EBNF (WSN) the syntax is case-statement = "CASE" expression "OF" case

  1   2   3   4   5   6   >