Re: [fpc-pascal] Unicode output on console works for me on Linux, not on Windows

2011-08-01 Thread Ondrej
> I think that you have to configure the console to use UTF-8 output (but I > don't know how this is done on Windows). I think that should be: SetConsoleOutputCP(CP_UTF8); ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepasc

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 ch

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. Woul

Re: [fpc-pascal] function const default argument

2021-08-26 Thread Ondrej Pokorny via fpc-pascal
r function declaration. Const parameters don't accept const expressions? You need: const  DefaultDelta = 1E-8; function F(const x:extended; const delta:extended=DefaultDelta):extended; Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freep

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

2021-09-17 Thread Ondrej Pokorny via fpc-pascal
used since Unicode Delphi because Char=UnicodeChar. Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2022-05-27 Thread Ondrej Pokorny via fpc-pascal
k you, and thank you to the entire Free Pascal team for everything you've all built. Sven & Blaise, I thank you for this enormous achievement as well! Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.

Re: [fpc-pascal] TFPHTTPServer and HTTPS

2022-08-23 Thread Ondrej Pokorny via fpc-pascal
:= fCertificateFileName;     fServer.CertificateData.PrivateKey.FileName := fCertificatePrivateKey;   end; That should be sufficient. FPC 3.2.2 should do it. Ondrej Am 23.08.2022 um 22:26 schrieb Fabio Luis Girardi via fpc-pascal: Hi Michael! Thanks for replying so fast. You're telling me that is pos

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

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
   TProcLongInt = interface(IInterface) procedure Invoke(aArg: LongInt); stdcall; overload;    end; You should be able to get the Invoke procedure pointer from the RTTI. Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https

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

2022-09-11 Thread Ondrej Pokorny via fpc-pascal
nested; function TestNested: TProc; begin result := procedure // why is this possible? begin writeln(data); end; It is not a nested function but an anonymous one. Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.f

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 /

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

2022-09-27 Thread Ondrej Pokorny via fpc-pascal
meTwo, meThree, meUnused2, meFive); 2.) publish their ordinal value public   property MyEnum: TMyEnum read FMyEnum write FMyEnum; published   property MyEnumOrd: Integer read GetMyEnumOrd write SetEnumOrd; // gets/sets MyEnum as ordinal value Ondrej ___

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

2022-10-15 Thread Ondrej Pokorny via fpc-pascal
? Though I am not Mattias and cannot comment on his preferences: CodeTools are part of the Lazarus project, hence the question belongs to the Lazarus mailing list https://lists.lazarus-ide.org/listinfo/lazarus or one of the IDE categories in the forum. Ondrej

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

2022-12-16 Thread Ondrej Pokorny via fpc-pascal
isn't changed anyway. Do I need to run ApplyUpdates as well? Isn't a commit enough? I'll check it again. Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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
umAttr;     constructor Create(Values: array of string); --- Or, if the enum values are valid identifiers, you can simple use scoped enums: {$SCOPEDENUMS ON}   TMyEnum = (YES, NO, COULD_BE); and the usual TypeInfo methods. Ondrej On 23.12.2022 06:35, Andrew Haines via fpc-pascal wrote: So, I

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)   prote

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
mpiler warns you with an error when you add a new value to the enum and you don't declare a string value for it. Ondrej program EnumAttrTest; {$mode objfpc}{$H+} {$modeswitch prefixedattributes} uses SysUtils, TypInfo; type EnumValues = class(TCustomAttribute) public function OrdT

[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
d old "fppkg.cfg" to "fppkg.bak" Writing sample configuration file to /etc/fppkg/default Saved old "default" to "default.bak" End of installation. Do you know what I am missing to build FPC main from Git? Btw. I can build pas2js with a simple "make" just fine... I am lost :( Thanks Ondrej ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

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 17:54, Ondrej Pokorny via fpc-pascal wrote: # number of threads set usethreads=4 I found it... I copied&pasted it from windows, on Linux it must be: # number of threads usethreads=4 Thanks anyway Ondrej ___ fpc-pascal mail

Re: [fpc-pascal] Windows Display Settings

2023-05-13 Thread Ondrej Pokorny via fpc-pascal
than pascal. Search for "delphi set display settings" or "winapi set display settings" in google to find some resources. E.g. https://stackoverflow.com/questions/956870/using-changedisplaysettingsex-in-delphi-to-set-primary-monitor Ondrej ___

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

2024-06-06 Thread Ondrej Pokorny via fpc-pascal
t mingw32 binaries and registered the search path with: -Xe -XRp:\software\MinGW\mingw32\bin But it didn't not help - still the same error. Can anybody help please? Delphi can link the OBJ file without problems. Thanks Ondrej ___ f

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

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. To

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