[fpc-pascal] "Hello world" syscalls

2020-01-06 Thread Vojtěch Čihák via fpc-pascal
Hi,   I found this article: https://drewdevault.com/2020/01/04/Slow.html but FPC is missing, so I wrote simple:   program Project1; begin   writeln('Hello world!'); end.    $ fpc -O3 -XX Project1.pas   $ strace -C ./Project1   % time     seconds  usecs/call     calls    errors syscall --

Re: [fpc-pascal] TFPObjectlist example

2020-09-08 Thread Vojtěch Čihák via fpc-pascal
with it comfortably   MyList[1].Port:='abc';   V. __ Od: "Vojtěch Čihák via fpc-pascal" Komu: ja...@productionautomation.net, "FPC-Pascal users discussions" Datum: 08.09.2020 16:21 Předmět: Re: [fpc-pascal] T

Re: [fpc-pascal] TFPObjectlist example

2020-09-08 Thread Vojtěch Čihák via fpc-pascal
Hi,   I used TFPObjectList only once, for visual component TECAccordion (https://wiki.lazarus.freepascal.org/Eye-Candy_Controls#TECAccordion). Each item of list is derived from TWinControl so it is possible to use it even for visual components (like TCollection).   However, in your case

Re: [fpc-pascal] TFPGMapObject duplicate errors

2020-10-01 Thread Vojtěch Čihák via fpc-pascal
I looked to code, it gives error only when map is Sorted=True.   function TFPSMap.Add(AKey: Pointer): Integer; begin   if Sorted then   begin     if Find(AKey, Result) then       case Duplicates of         dupIgnore: exit;         dupError: Error(SDuplicateItem, 0)       end;   end else    

Re: [fpc-pascal] TFPGList and objects

2020-05-28 Thread Vojtěch Čihák via fpc-pascal
There is TFPGObjectList for objects.   BTW, is FGL a good choice for generics? Some time ago Marco wrote here that FGL is moreless a technology demonstrator and Generics.Collection or other libraries should be used instead.   Thanks for reply   V.  

Re: [fpc-pascal] LongInt and LongWord types

2020-07-09 Thread Vojtěch Čihák via fpc-pascal
I suspect Embarcadero that they often intently design Delphi to be not compatible with FPC. V. __ Od: "Sven Barth via fpc-pascal" Komu: fpc-pascal@lists.freepascal.org Datum: 09.07.2020 07:30 Předmět: Re: [fpc-pascal] LongInt and

Re: [fpc-pascal] Access Violation on second compile with FPC Text IDE

2020-11-12 Thread Vojtěch Čihák via fpc-pascal
Hello,   look at this bugreport. I reported it as a Lazarus issue but now it looks like FPC trunk issue.   https://bugs.freepascal.org/view.php?id=37856   Vojtech aka Blaazen __ Od: "C Western via fpc-pascal" Komu:

Re: [fpc-pascal] FPC 3.2.2 released

2021-05-27 Thread Vojtěch Čihák via fpc-pascal
Hello and thanks.   I downloaded 3.2.2 (tar), I installed it successfully. I used it to compile the latest 3.3.1 trunk, again successfully. And I used this 3.3.1 to build the Lazarus 2.1.0 trunk (65138). Also successfully.   Everything seems be OK. Vojtěch a.k.a. Blaazen

Re: [fpc-pascal] Formatting Question

2021-04-03 Thread Vojtěch Čihák via fpc-pascal
Hi,   I tried this (add StrUtils to uses):   procedure TForm1.Button1Click(Sender: TObject); var i, l: Integer;     aV: Double;     aF: TFormatSettings; begin   aF.DecimalSeparator:='.';   aF.ThousandSeparator:=' ';   for i:=-2 to 10 do     begin       aV:=pi*power(10, i);      

Re: [fpc-pascal] How to use XMLCfg?

2021-08-08 Thread Vojtěch Čihák via fpc-pascal
Hi,   Laz2_ are UTF8 versions and they works well. Create(nil); means that instance has no owner. (I have Lazarus 2.3.0, it is not on line 165 here).   You can try demo at ../examples/xmlstreaming/.. It works here.   V. __ Od: "Abuy

Re: [fpc-pascal] How to get fpc and lazarus sources when svn has shut down?

2021-08-12 Thread Vojtěch Čihák via fpc-pascal
Hi,   my numbers of Lazarus on Linux, Qt (incl. binaries and *.ppu and *.o files)   SVN: lazarus dir: 2.6 GB (4 files, 1300 dirs) .svn subdir: 1.6 GB (25000 files, 260 dirs)   GIT: lazarus dir: 1 GB (15000 files, 950 dirs) .git subdir: 150 MB (60 files, 40 dirs)   V.  

[fpc-pascal] Problem with code aligning (probably)

2022-10-19 Thread Vojtěch Čihák via fpc-pascal
Hi,   I wrote a generic class to test sorting algorithms and also benchmarking them. I have following problem:   When I change even a single line of code anywhere in that unit, even in an unrelated method, all ~40 algorithms become a little slower or a little faster. I observed it has two

Re: [fpc-pascal] Problem with code aligning (probably)

2022-10-19 Thread Vojtěch Čihák via fpc-pascal
.   __ Od: "Vojtěch Čihák via fpc-pascal" Komu: "FPC-Pascal users discussions" Datum: 19.10.2022 15:37 Předmět: [fpc-pascal] Problem with code aligning (probably) Hi, ...   Thanks for help. ___

Re: [fpc-pascal] Problem with code aligning (probably)

2022-10-19 Thread Vojtěch Čihák via fpc-pascal
solve it reversely:  -OaJUMP=1 to -OaJUMP=2.   Of course, I'd like some persistent solution.   V.   __ Od: "Vojtěch Čihák via fpc-pascal" Komu: "FPC-Pascal users discussions" Datum: 19.10.2022 17:39 Předmět: Re:

Re: [fpc-pascal] Problem with code aligning (probably)

2022-10-20 Thread Vojtěch Čihák via fpc-pascal
2022 00:24, Vojtěch Čihák via fpc-pascal wrote: That's not easy, unfortunately: https://www.youtube.com/watch?v=r-TLSBdHe1A <https://www.youtube.com/watch?v=r-TLSBdHe1A> Jonas ___ fpc-pascal maillist  -  fpc-pascal@lists.free

[fpc-pascal] Local Type T and generics

2022-12-31 Thread Vojtěch Čihák via fpc-pascal
Hi,   I have local type TTempItem, i.e. declared inside method of a generic class. When I write: type       TTempItem = record        Item: T;        Empty: Boolean;      end; I got: Identifier not found "T".   When I write: type      TTempItem = record        Item: TBaseGList.T;  //name of the

Re: [fpc-pascal] Local Type T and generics

2023-01-03 Thread Vojtěch Čihák via fpc-pascal
T and generics Am 31.12.2022 um 14:34 schrieb Vojtěch Čihák via fpc-pascal: > Is this intended? Or known bug? It's a bug. Please report with a full example. Regards, Sven ___ fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org https://lists

Re: [fpc-pascal] Dynamic array question

2023-01-12 Thread Vojtěch Čihák via fpc-pascal
Sluis via fpc-pascal" Komu: fpc-pascal@lists.freepascal.org Datum: 12.01.2023 00:22 Předmět: Re: [fpc-pascal] Dynamic array question Vojtěch Čihák via fpc-pascal schreef op wo 11-01-2023 om 23:38 [+0100]: > is there a way how to have dynamic array "inside" another dynamic >

[fpc-pascal] Dynamic array question

2023-01-11 Thread Vojtěch Čihák via fpc-pascal
Hi,   is there a way how to have dynamic array "inside" another dynamic array?   program project1; {$mode objfpc}{$H+}   uses   {$IFDEF UNIX}   cthreads,   {$ENDIF}   Classes, SysUtils   { you can add units after this };   {$R *.res} type   TDynArray = array of Integer;   PTDynArray = ^TDynArray;

Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-18 Thread Vojtěch Čihák via fpc-pascal
-Pascal users discussions" Datum: 18.11.2022 20:45 Předmět: Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class Em seg., 14 de nov. de 2022 15:26, Vojtěch Čihák via fpc-pascal > escreveu:,What do you mean by "be inlined"? The

Re: [fpc-pascal] Program efficiency

2022-11-09 Thread Vojtěch Čihák via fpc-pascal
Hi,   I noticed this too a few years ago when I translated xxHash from C to FPC. Pushing the code to less lines improved speed so xxHash32 was as fast as in C.   do { v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4; v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4; v3 =

Re: [fpc-pascal] Program efficiency

2022-11-09 Thread Vojtěch Čihák via fpc-pascal
Sorry, it was copy-paste from github and it broke formatting   do {       v1 = XXH32_round(v1, XXH_get32bits(input)); input += 4;       v2 = XXH32_round(v2, XXH_get32bits(input)); input += 4;       v3 = XXH32_round(v3, XXH_get32bits(input)); input += 4;       v4 = XXH32_round(v4,

[fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-14 Thread Vojtěch Čihák via fpc-pascal
Hi,   I wrote a generic abstract class - a list based on dynamic array (i.e. array of T;) and this class can be specialized elsewhere with any type (records or classes). Part of the class is sorting. There are more ways how to deliver *compare function* to sorting method. I can pass it as a

Re: [fpc-pascal] possible bug in blockwrite

2023-03-05 Thread Vojtěch Čihák via fpc-pascal
Hi,   you can use PChar, or string+retype to PChar in blockwrite:    BlockWrite(f1, PChar(s)^, length(s));    which gives expected result. V. __ Od: "Travis Siegel via fpc-pascal" Komu: "FPC-Pascal users discussions" Datum: 05.03.2023

Re: [fpc-pascal] IRC channel for FreePascal support ?

2023-04-13 Thread Vojtěch Čihák via fpc-pascal
Hi,   I'm almost fourteen years on the forum and a few years less on mailing lists and I never had a single problem. I don't attend IRC so I can't say what's wrong there. OTOH I read Joanna's comments on the forum and they are OK (to the topic; non conflict).   V.