[fpc-pascal] Why the difference in the rounded results?

2021-10-15 Thread Gabor Boros via fpc-pascal
Hi All, I got different results with 32bit vs. 64bit, 3.2.2 vs. 3.3.1, FPC vs. Delphi. Why? var d1,d2:Double; begin d1:=20.5; d2:=1.05; Writeln(RoundTo(d1*d2,-2)); Writeln(SimpleRoundTo(d1*d2)); d1:=28.9; Writeln; Writeln(RoundTo(d1*d2,-2)); Writeln(SimpleRoundTo(d1*d2));

[fpc-pascal] TEnumerator - After the last element?

2021-10-07 Thread Gabor Boros via fpc-pascal
Hi All, I need to know the current position is after the last element. The attached solution demonstrate what I want. Is an internal solution exists for this task? I not found anything. Gabor uses SysUtils, Generics.Collections; type TR=record i:Integer; end; TLEnumerator=class(sp

[fpc-pascal] Operators for a class

2020-12-31 Thread Gabor Boros via fpc-pascal
Hi All, I try to convert some C++ source to FPC, see below a short example from it. How can I define same operator with FPC trunk? class Cla { INT64 Num; public: Cla operator +(const Cla& m) { Cla ret(this); ret.Num += m.Num; return ret; } Gabor _

Re: [fpc-pascal] Worse performance with 64bit binary

2020-07-25 Thread Gabor Boros
2020. 07. 25. 18:42 keltezéssel, Florian Klämpfl írta: Am 25.07.20 um 16:49 schrieb Gabor Boros: Hi All, I cannot show the real application but attached a simple example. If compile with 3.2.0 "ppc386.exe -O3 test.pas" the execution time of the resulting example binary is 0.4s, a

[fpc-pascal] Worse performance with 64bit binary

2020-07-25 Thread Gabor Boros
Hi All, I cannot show the real application but attached a simple example. If compile with 3.2.0 "ppc386.exe -O3 test.pas" the execution time of the resulting example binary is 0.4s, and 2.2s if compile with "ppcx64.exe -O3 test.pas". Any idea why? Gabor {$Mode objfpc} uses SysUtils; functio

Re: [fpc-pascal] Why external execution so slow? (fixed)

2020-04-01 Thread Gabor Boros
2020. 04. 01. 17:21 keltezéssel, Marco van de Voort írta: But at least FPC3.2.0rc1 has a rewritten tprocess/runcommand that makes this fixable without source changes and recompilation, look at the next example: It's fast but FPC's help not showed on the screen. Gabor

Re: [fpc-pascal] Why external execution so slow?

2020-04-01 Thread Gabor Boros
2020. 03. 31. 19:37 keltezéssel, Gabor Boros írta:   RunCommandInDir('E:\FPC\3.2.0\bin\i386-win32','fpc.exe',['-h'],OS,[]); Tried with modified(fpc -h) "Reading large output" example (https://wiki.freepascal.org/Executing_External_Programs#Reading_la

Re: [fpc-pascal] Why external execution so slow?

2020-04-01 Thread Gabor Boros
2020. 03. 31. 23:31 keltezéssel, Alexander Grotewohl írta: The other though I had is that your E: is going to sleep while you're programming and the first execution requires the drive to spin up again. Same result if use a ramdisk. Gabor ___ fpc-pasc

Re: [fpc-pascal] Why external execution so slow?

2020-04-01 Thread Gabor Boros
2020. 03. 31. 23:21 keltezéssel, Marco van de Voort írta: Antivirus? No. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Why external execution so slow?

2020-03-31 Thread Gabor Boros
Hi All, I need to execute an external program from my application. This execution is much slower than execute the external application from command line. I made a simple example (see below) which show 1.7 seconds for me. Why? (From command line the execution time is 15 milliseconds. I used Win

[fpc-pascal] Is TryStrToDate works wrong?

2020-01-04 Thread Gabor Boros
Hi All, var DT:TDateTime; begin Writeln(BoolToStr(TryStrToDate('1',DT),True)); The result of above code is "True" with FPC and "False" with Delphi. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cg

[fpc-pascal] How to translate C macros which use stringification?

2019-11-22 Thread Gabor Boros
Hi All, I made a simple example to demonstrate the problem: #include using namespace std; #define MACRO1(x)\ cout << #x << "(" << (x) << ")"; \ int main() { int var1; var1 = 44; MACRO1(var1); return 0; } The result of this simple example on t

[fpc-pascal] String type with specified length and without codepage

2019-08-18 Thread Gabor Boros
Hi All, I try to rewrite some C/C++ code with FPC. I don't know which is the best string handling technique in this case. The original code for example: char b_l[b_list_len][bn_len+1]; char s_n[sn_len+1]; I do not want to fight with "char"s or "byte"s. Just want to use the easier way which

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-30 Thread Gabor Boros
2019. 04. 30. 2:45 keltezéssel, wkitt...@windstream.net írta: are you saying that you are trying to use fixed-width fields that are space-padded in XML files??? No. The XML files are exists already. The task is... Load the contents/file to a TObject descendant, modify the data in the object(s)

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-29 Thread Gabor Boros
2019. 04. 28. 21:24 keltezéssel, Santiago A. írta: If you need the same indent or special chars, XML is not the right format for you. Consider it XML is not my choice. ;-) Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://li

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-29 Thread Gabor Boros
2019. 04. 28. 9:25 keltezéssel, Gabor Boros írta: The "indent" and "text content" problems solved on the reader side by ReadXMLFilePreserveWhitespace: With a sample application but not with the real life application. :-( (My real application just find node for every

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-28 Thread Gabor Boros
2019. 04. 28. 9:35 keltezéssel, Michael Van Canneyt írta: the newly exposed XMLWriter Will be merged/backported into fixes_3_2? Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fp

Re: [fpc-pascal] XML - Indent, text content, special char

2019-04-28 Thread Gabor Boros
2019. 04. 27. 13:57 keltezéssel, Michael Van Canneyt írta: As far as I know you can't. I recently changed some things in xmlwriter so you can influence the formatting to some degree, but no attempt is made to respect the formatting of a previously read file. I believe the formatting info is disc

[fpc-pascal] XML - Indent, text content, special char

2019-04-27 Thread Gabor Boros
Hi All, I have an existing XML file. After load(, modify) and save this file some mandatory formatting things lost from it. I need same indent as before, same text contents and not replace every special chars. With the below code I got the attached OUTPUT.xml from the attached INPUT.xml. Any

Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-25 Thread Gabor Boros
2018. 05. 24. 9:37 keltezéssel, Michael Van Canneyt írta: Are these functions callbacks ? If so, is the calling convention correct ? I used xmlSchemaSetValidErrors and the documentation say "Set the error and warning callback informations". Tried with and without cdecl. Meanwhile tried xmlS

Re: [fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-23 Thread Gabor Boros
Same problem with Win64. So not Linux specific. Gabor 2018. 05. 22. 10:06 keltezéssel, Gabor Boros írta: Hi All, I need to accomplish validate XML files with an XSD. Found libxml in packages and works as expected with Win32. But I have problem with messages on Linux 64bit. Got %s instead

[fpc-pascal] Libxml2 - How to get messages on Linux?

2018-05-22 Thread Gabor Boros
Hi All, I need to accomplish validate XML files with an XSD. Found libxml in packages and works as expected with Win32. But I have problem with messages on Linux 64bit. Got %s instead the real message text. I use the below code to get the messages. Any idea why not works with Linux64 bit? va

Re: [fpc-pascal] TStringList - Strange quotation mark handling

2017-08-16 Thread Gabor Boros
2017. 08. 16. 15:21 keltezéssel, Michael Van Canneyt írta: Because the quotes must be the first and last character of each string (or "cell"). As noted in another reply, set the quote character to something unused, and it will disable (or circumvent) quoting altogether. SL2.QuoteChar:=#0; sol

Re: [fpc-pascal] TStringList - Strange quotation mark handling

2017-08-16 Thread Gabor Boros
2017. 08. 16. 15:15 keltezéssel, Kevin Jesshope írta: Setting the quotechar to something impossible (linefeed, #0 etc) stops the quote processing. SL2.QuoteChar:=#0; solved my problem. Thank you! Gabor ___ fpc-pascal maillist - fpc-pascal@lists.fre

[fpc-pascal] TStringList - Strange quotation mark handling

2017-08-16 Thread Gabor Boros
Hi All, With the attached example program and data.csv I got the next result: 0 * 84392 1 * asfds 2 * hytr 3 * 43421454 4 * O 5 * fdsfds 6 * 654645645 "O" fdsfsd 7 * hgfgfedw 8 * fg 9 * 321.544 10 * 89 11 * 0 "O" fdsfds - broken into two parts which is bad from my POV. See 4 * O and 5 * fds

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Gabor Boros
2017. 06. 14. 10:28 keltezéssel, José Mejuto írta: That's wrong for sure, x is not initialized to nil, not in Linux nor in Windows. With the below code caption of the form not changed on Linux for me. procedure TForm1.FormCreate(Sender: TObject); var x:TPanel; begin if Assigned(x) then Ca

[fpc-pascal] SIGSEGV in fpc_check_object

2017-06-13 Thread Gabor Boros
Hi All, In my Lazarus application I use a TPanel descendant component (TMyPanel) which have subpanels (TMySubPanel) which are TPanel descendants also. The subpanels accessed through a TList. If add a new subpanel into the main panel added to the list with TList.Add if remove a subpanel from it

Re: [fpc-pascal] How to split file of whitespace separated numbers?

2016-12-23 Thread Gabor Boros
2016. 12. 23. 9:14 keltezéssel, Bo Berglund írta: Is there a quick way to split a string of whitespace separated values into the separate members? Hi, I don't know quick or not... program Project1; uses Classes; var SL:TStringList; i:Integer; begin SL:=TStringList.Create; SL.Delimi

Re: [fpc-pascal] Implicit conversion problem with TDate type

2016-11-02 Thread Gabor Boros
2016. 11. 02. 11:38 keltezéssel, Michael Van Canneyt írta: If Delphi prints another result, then we can look at fixing the implementation. With Delphi 10.1 and "D: TDate;" the result is "date is 5" and with "D: TDateTime;" the result is "date is 7". So, the results are same with FPC and Delph

[fpc-pascal] Implicit conversion problem with TDate type

2016-11-02 Thread Gabor Boros
Hi All, I use MWA's IBX for Firebird connection and have problem with date parameters. Tony provided to me a test program a suggested write to the FPC list. The simple test program is: program Project1; uses Variants, Sysutils; var V: variant; D: TDate; begin D := EncodeDate(2016,10,

Re: [fpc-pascal] Can I open XZ compressed text file on the fly?

2016-10-27 Thread Gabor Boros
2016. 10. 27. 4:29 keltezéssel, Graeme Geldenhuys írta: On 2016-10-26 14:58, Gabor Boros wrote: Can I open it without decompress it to the file system Yes, simply use any component that implements the LZMA/LZMA2 compression algorithms. You should then be able to decompress it in memory. I

[fpc-pascal] Can I open XZ compressed text file on the fly?

2016-10-26 Thread Gabor Boros
Hi All, I need to analyze log file but its compressed with XZ. Can I open it without decompress it to the file system or can decompress in memory for example into a TStringList? Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http:

Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition

2016-08-24 Thread Gabor Boros
Anyone knows if Windows 7 would also work? http://docwiki.embarcadero.com/RADStudio/Berlin/en/Installation_Notes#Operating_System_Requirements Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailma

Re: [fpc-pascal] Free Delphi 10.1 Berlin Starter Edition

2016-08-23 Thread Gabor Boros
2016. 08. 23. 17:40 keltezéssel, Dennis írta: I miss its lightning fast compiler and good debugger. +1 Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Access C++ APIs

2016-06-30 Thread Gabor Boros
2016. 06. 29. 17:11 keltezéssel, Dimitrios Chr. Ioannidis írta: AFAIK, the Firebird New API is interface based not a C++ API. Thank you for the clarification! (Firebird written in C/C++ and 3.0 have a new OO API, from this combination I think the new API is C++. :-) ). Gabor

[fpc-pascal] Access C++ APIs

2016-06-29 Thread Gabor Boros
Hi All, I want to play a little with a fresh Qt 5.x. Lazarus access Qt through Qt4Pas. I see "Linking with C++ code" in future plans for FPC. Is there another way? For example I can access OO API of Firebird 3 with the provided pas file. Is it a special Firebird thing or a general solution? S

Re: [fpc-pascal] Object Pascal Handbook

2015-08-07 Thread Gabor Boros
2015.08.07. 13:13 keltezéssel, Gour írta: I wonder, being FPC noob, how suitable it can be for learning FPC? Hi, The official documentation is not a good start point? http://www.freepascal.org/docs.var http://wiki.freepascal.org/FPC_documentation Gabor __

[fpc-pascal] How to force unique field values with TBufDataSet

2015-04-27 Thread Gabor Boros
Hi All, Added ixUnique type index with IndexDefs or AddIndex, set IndexName or IndexFieldNames. But no effect, I can add same field values without any error. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.o

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-26 Thread Gabor Boros
2013.12.26. 18:03 keltezéssel, Pierre Free Pascal írta: Please test again. Sorry for the mistake. Pierre Muller Downloaded, installed and works like a charm. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepas

Re: [fpc-pascal] Free Pascal 2.6.4-rc1 released!

2013-12-26 Thread Gabor Boros
2013.12.26. 0:33 keltezéssel, Gerhard Scholz írta: I downloaded ftp://freepascal.stack.nl/pub/fpc/beta/2.6.4-rc1/i386-win32/fpc-2.6.4rc1.i386-win32.exe The setup the said: "The setup files are corrupted. Please obtain a new copy of the program." I did that; the second copy also didn't work.

Re: [fpc-pascal] Win64 release of FPC 2.6.2 missing

2013-05-01 Thread Gabor Boros
2013.04.30. 20:39 keltezéssel, Graeme Geldenhuys írta: Hi, I just tried to update one of my Windows VM with the latest released FPC. To my surprise there is no Win64 release for FPC 2.6.2 on SourceForge? I only found a 32-bit cross-compiler. Why is this? Regards, - Graeme - http://sourc

Re: [fpc-pascal] Free Pascal 2.6.2 - 64 - setup

2013-02-26 Thread Gabor Boros
2013.02.26. 15:20 keltezéssel, silvioprog írta: Hello, There are a setup to install FPC 2.6.2 stable 64 bit? In SF (http://sourceforge.net/projects/freepascal/files) have only 32. Thanks. -- Silvio Clécio My public projects - github.com/silvioprog http://sourc

Re: [fpc-pascal] Re: CrossFPC is finally released

2012-12-31 Thread Gabor Boros
2012.12.31. 0:18 keltezéssel, Ralf A. Quint írta: At 03:01 PM 12/30/2012, leledumbo wrote: Ok, still 33h to go 'til the end of December 2012 in this part of the world, let's see if something is going to happen (or not...) Ralf https://forums.embarcadero.com/thread.jspa?threadID=81323&tstart=0

Re: [fpc-pascal] Lazarus settings and roaming profiles in Windows

2009-07-15 Thread Gabor Boros
Hi, I don't know the answer for your question but I know a separate Lazarus mailing list exist. http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus Gabor Jürgen Hestermann írta: I am not sure whether there exists a separate mailing list just for Lazarus so I am posting this here:

Re: [fpc-pascal] When is FPC 2.2.4 docs available?

2009-05-09 Thread Gabor Boros
Hi, ftp://ftp.freepascal.org/pub/fpc/dist/2.2.4/docs Gabor Graeme Geldenhuys írta: Hi, FPC 2.2.4 has already been released a while back, but the documentation available for download (PDF files) are rather old. Could new docs be generated and made available for download. Not everybody has the

Re: [fpc-pascal] Convert complicated string to DateTime

2009-03-04 Thread Gabor Boros
leledumbo írta: What's the output of this: FormatDateTime(' dd hh:nn:ss ',Now); március 04 09:42:02 2009 that way you can understand what you should supply to ScanDateTime as the corresponding value for format. I mean, maybe it's not November, but something else equivalent in

Re: [fpc-pascal] Convert complicated string to DateTime

2009-03-03 Thread Gabor Boros
And? I don't understand your suggestion. leledumbo írta: Gabor Boros wrote: Hi, I want to convert a string to a TDateTime variable. In example the string is: 'November 21 09:42:21 2008'. I tried ScanDateTime with ' dd hh:nn:ss ' pattern but not working. Ho

[fpc-pascal] Convert complicated string to DateTime

2009-03-03 Thread Gabor Boros
Hi, I want to convert a string to a TDateTime variable. In example the string is: 'November 21 09:42:21 2008'. I tried ScanDateTime with ' dd hh:nn:ss ' pattern but not working. How can I convert this type of string to DateTime? Gabor ___ f

[fpc-pascal] SScanf question

2008-11-30 Thread Gabor Boros
Hi, SScanf('123: aaa :456','%d: %s :%d',[EMAIL PROTECTED],@string1,@integer2]); In this situation string1 is aaa. It is correct. SScanf('123: bbb aaa :456','%d: %s :%d',[EMAIL PROTECTED],@string1,@integer2]); In this situation string1 is bbb. But I need the whole string(bbb aaa). And I don't

Re: [fpc-pascal] Un/De-Format function still exists?

2008-11-25 Thread Gabor Boros
Thank you! Gabor JoshyFun írta: Look for "SScanf" function, maybe it will fit your needs. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Un/De-Format function still exists?

2008-11-25 Thread Gabor Boros
Hi, Result of Format('abc: %d def: %d',[1,2]) is 'abc: 1 def: 20'. It's ok , but I want to do this thing from the other direction. I want to know the integers only and the strings ('abc') not the same in every line in a text file. Is a function/procedure still exists in FPC or Lazarus for this

Re: [fpc-pascal] Good revision on wince cross-compiler

2006-12-08 Thread Gabor Boros
Hi, 5191 works very well for me. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] How can i detect what cause the problem

2006-11-14 Thread Gabor Boros
Many thanks Felipe, the problem is the exported name(s). The exported names is SCAN_AllocateBuffer_A and SCAN_AllocateBuffer_W. Thanks again! Gabor Felipe Monteiro de Carvalho írta: Can you show us the c declaration of the function you are calling? It should be on a .h file. Also, you should

[fpc-pascal] How can i detect what cause the problem

2006-11-14 Thread Gabor Boros
Hi, I have a Symbol mobile device with an integrated barcode scanner. The scanner's API in C and I cannot use every API calls. An example: The problem appears in the ScanBuffer:=SCAN_AllocateBuffer(TRUE,dwScanSize); line (see the test app below). If I run in GDB the error message is: warning:

[fpc-pascal] C API call problem under WinCE

2006-11-06 Thread Gabor Boros
Hi, If I start the test application on the WinCE device the result is: "project1.exe is not a valid Windows CE application." If I comment out the SCAN_FindFirst call, the application run properly. See below for the C header, and the test app. Any suggestions? Many Thanks! Gabor The C header fil

[fpc-pascal] Compile error in sources from SVN Rev. 4420

2006-08-14 Thread Gabor Boros
Hi, The problem is, missed keyword 'class' in zipper.pp line 368 and 439. Gabor ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal