Re: [fpc-pascal] How to use external linker on windows i386

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
On 06.06.2024 11:16, Sven Barth via fpc-pascal wrote: Ondrej Pokorny via fpc-pascal schrieb am Do., 6. Juni 2024, 09:30: Hello, I am on Windows 64bit, but using the i386 compiler. I have to link a 3rd party OBJ file with {$L 'xyz.obj'}. With the internal linker I get

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
On 06.06.2024 09:19, Ondrej Pokorny via fpc-pascal wrote: writeln() converts the ordinal value to the value name and if the entry is not found, the 107 error is raised. Ondrej On 06.06.2024 06:22, Hairy Pixels via fpc-pascal wrote: [ ... ] how this works at runtime is another question

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
writeln() converts the ordinal value to the value name and if the entry is not found, the 107 error is raised. Ondrej On 06.06.2024 06:22, Hairy Pixels via fpc-pascal wrote: This program below crashes because the value 12 is not in the enum. I was curious though, how does it know this? Does

[fpc-pascal] How to use external linker on windows i386

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
Hello, I am on Windows 64bit, but using the i386 compiler. I have to link a 3rd party OBJ file with {$L 'xyz.obj'}. With the internal linker I get these errors: Error: COMDAT selection mode 0 not supported (section: "0") Error: Failed reading coff file, invalid section index while reading 

Re: [fpc-pascal] Windows Display Settings

2023-05-13 Thread Ondrej Pokorny via fpc-pascal
On 13.05.2023 19:20, James Richters via fpc-pascal wrote: Is there some way with FreePascal that I can Get / Set the windows display settings for multiple monitors like their resolutions, portrait/landscape, scale factors, and if they are disconnected or not? That is more a WinAPI question

Re: [fpc-pascal] Building fpc trunk on Linux: Could not find unit directory for dependency package "rtl" required for package "a52"

2023-04-27 Thread Ondrej Pokorny via fpc-pascal
On 27.04.2023 17:54, Ondrej Pokorny via fpc-pascal wrote: # number of threads set usethreads=4 I found it... I copied it from windows, on Linux it must be: # number of threads usethreads=4 Thanks anyway Ondrej ___ fpc-pascal maillist - fpc

Re: [fpc-pascal] Building fpc trunk on Linux: Could not find unit directory for dependency package "rtl" required for package "a52"

2023-04-27 Thread Ondrej Pokorny via fpc-pascal
On 27.04.2023 17:54, Ondrej Pokorny via fpc-pascal wrote: On 27.04.2023 15:54, Ondrej Pokorny via fpc-pascal wrote: OK, I searched for the error and found this page: https://wiki.freepascal.org/FPMake#Could_not_find_unit_directory_for_dependency_package_.22rtl.22 OK, I made the fpmake command

Re: [fpc-pascal] Building fpc trunk on Linux: Could not find unit directory for dependency package "rtl" required for package "a52"

2023-04-27 Thread Ondrej Pokorny via fpc-pascal
On 27.04.2023 15:54, Ondrej Pokorny via fpc-pascal wrote: OK, I searched for the error and found this page: https://wiki.freepascal.org/FPMake#Could_not_find_unit_directory_for_dependency_package_.22rtl.22 Even if I do export FPCDIR=/usr/lib/fpc/3.2.2 before make (where the installer installed

[fpc-pascal] Building fpc trunk on Linux: Could not find unit directory for dependency package "rtl" required for package "a52"

2023-04-27 Thread Ondrej Pokorny via fpc-pascal
Hello, I am lost :/ I installed FPC 3.2.2 from the TAR file as described here: https://www.freepascal.org/docs-html/user/usersu5.html I did "sudo ./install" and kept everything default. Now, I want to build fpc main from Git. I do: make clean all OPT='-O- -gw -godwarfsets -gl -Xg' DEBUG=1

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-25 Thread Ondrej Pokorny via fpc-pascal
Am 23.12.2022 um 15:50 schrieb Andrew Haines via fpc-pascal: Error: Ordinal expression expected [TEnumAttr(['YES', 'NO', 'COULD_BE'])] There is another (and cleaner) approach that uses an abstract attribute class. See attachment. The advantage is that the compiler warns you with an error

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Ondrej Pokorny via fpc-pascal
On 23.12.2022 15:50, Andrew Haines via fpc-pascal wrote: On 12/23/22 5:24 AM, Ondrej Pokorny via fpc-pascal wrote: This may be simpler: [TEnumAttr(['YES', 'NO', 'COULD_BE'])]   TMyEnum = (meYes, meNo, meCouldBe); TEnumAttr = class(TCustomAttribute)   protected     FValues: TStringArray

Re: [fpc-pascal] Unrelated type helpers with the same members? Implement an interface with a type helper?

2022-12-23 Thread Ondrej Pokorny via fpc-pascal
This may be simpler: [TEnumAttr(['YES', 'NO', 'COULD_BE'])]   TMyEnum = (meYes, meNo, meCouldBe); TEnumAttr = class(TCustomAttribute)   protected     FValues: TStringArray;     FTypeName: String;   public     class function FromType(ATypeInfo: PTypeInfo): TEnumAttr;     constructor

Re: [fpc-pascal] SqlDB TSQLQuery sqoAutoApplyUpdates does not work with ExecSQL

2022-12-16 Thread Ondrej Pokorny via fpc-pascal
Hello, I've got a similar problem about 2 days ago. I have a stored MSSQL procedure that changes a table. When it is run in SQL Managements Studio, the data get changed. When I run it with FPC, it runs fine but nothing changes. I do commit the transaction explicitly but the data isn't

Re: [fpc-pascal] Exploring block statements with CodeTools not working

2022-10-15 Thread Ondrej Pokorny via fpc-pascal
Am 16.10.2022 um 04:19 schrieb Hairy Pixels via fpc-pascal: Btw, I understand this question is basically for Mattias but I don’t know where else to post. Does Mattias prefer I post in one of these forums https://forum.lazarus.freepascal.org or maybe email privately with code tools questions?

Re: [fpc-pascal] Enum property can't be published

2022-09-27 Thread Ondrej Pokorny via fpc-pascal
Am 27.09.2022 um 11:22 schrieb Hairy Pixels via fpc-pascal: On Sep 27, 2022, at 4:17 PM, Marco van de Voort via fpc-pascal wrote: 3.2.2 compiles without warnings, 3.3.1 (i386-win32 from 17 sept:) ptt.pp(14,44) Warning: This property will not be published Possibly enums with assigned values

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
Am 11.09.2022 um 14:22 schrieb Sven Barth via fpc-pascal: Ondrej Pokorny via fpc-pascal schrieb am So., 11. Sep. 2022, 12:18: Shouldn't this assignment be forbidden? type TProc = procedure is nested; function TestNested: TProc; begin result := procedure // why

Re: [fpc-pascal] Why does nested function get corrupted?

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
Am 11.09.2022 um 11:26 schrieb Sven Barth via fpc-pascal: Hairy Pixels schrieb am Sa., 10. Sep. 2022, 03:21: > On Sep 9, 2022, at 4:48 PM, Sven Barth wrote: > > How about you simply report such corruptions as bugs? I can always close them as "not a bug" or duplicate if

Re: [fpc-pascal] Get TMethod from function reference

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
Am 09.09.2022 um 00:49 schrieb Hairy Pixels via fpc-pascal: On Sep 8, 2022, at 11:14 AM, Michael Van Canneyt via fpc-pascal wrote: It must keep this information somewhere, but this does not mean you can typecast it to a TMethod. Indeed. I wonder if this information could be exposed by some

Re: [fpc-pascal] TFPHTTPServer and HTTPS

2022-08-23 Thread Ondrej Pokorny via fpc-pascal
You need to set your certificate details as well:   fServer.UseSSL := fUseSSL;   if fUseSSL then   begin     fServer.CertificateData.KeyPassword := fCertificatePassword;     fServer.CertificateData.HostName := fCertificateHostName;     fServer.CertificateData.Certificate.FileName :=

Re: [fpc-pascal] Feature Announcement: Function References and Anonymous Functions

2022-05-27 Thread Ondrej Pokorny via fpc-pascal
On 27.05.2022 00:23, Zoë Peterson via fpc-pascal wrote: Sven, I'm absolutely thrilled to see this finally merged.  I sincerely appreciate all of the work that you and Blaise put into it over such a long time.  I can't wait to see what the community is able to do with it.  Thank you, and

Re: [fpc-pascal] String.Split(const Separators: array of Char; Options: TStringSplitOptions)

2021-09-17 Thread Ondrej Pokorny via fpc-pascal
On 17.09.2021 00:02, Michael Van Canneyt via fpc-pascal wrote: On Thu, 16 Sep 2021, Bart via fpc-pascal wrote: Hi, I must be missing something obvious. But given the following definition of the Split() helper function for strings: Function Split(const Separators: array of Char; Options:

Re: [fpc-pascal] function const default argument

2021-08-26 Thread Ondrej Pokorny via fpc-pascal
On 26.08.2021 09:40, Santiago A. via fpc-pascal wrote: const  DefaultDelta:extended = 1E-8; function F(const x:extended; const delta:extended=DefaultDelta):extended; function G(const x:extended; const delta:extended=DefaultDelta):extended; But I get "Illegal expression" in the header function

Re: [fpc-pascal] Why has the tkFloat default value changed?

2021-03-06 Thread Ondrej Pokorny via fpc-pascal
On 06.03.2021 4:29, Ondrej Pokorny wrote: On 05.03.2021 20:34, Sven Barth wrote: Am 28.02.2021 um 23:11 schrieb Mattias Gaertner via fpc-pascal: [...] I can't find this change in https://wiki.lazarus.freepascal.org/User_Changes_3.2.0 @Ondrej: you had supplied the patch back then. Would you

Re: [fpc-pascal] Why has the tkFloat default value changed?

2021-03-06 Thread Ondrej Pokorny via fpc-pascal
On 05.03.2021 20:34, Sven Barth wrote: Am 28.02.2021 um 23:11 schrieb Mattias Gaertner via fpc-pascal: [...] I can't find this change in https://wiki.lazarus.freepascal.org/User_Changes_3.2.0 @Ondrej: you had supplied the patch back then. Would you be able to describe what exactly changed