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

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: 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

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

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

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

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

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

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 TStringlist

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

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

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;   

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

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

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 = "("

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

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

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 

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 :=

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

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

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

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

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

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 anyth

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

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

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 s

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 ?

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;

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

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

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

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

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

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 ?

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

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 exceptionhandlers

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,

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" [

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

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

Re: [fpc-pascal] Question regarding building fpc from sources

2023-11-30 Thread Michael Van Canneyt via fpc-pascal
On Wed, 29 Nov 2023, Bo Berglund via fpc-pascal wrote: I have for many years been building my Linux versions of fpc and lazarus from sources downloaded first from the svn repository and later from github. When doing the build on a new Linux system I need a seed compiler for the platform and

Re: [fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?y

2023-11-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Nov 2023, Bart via fpc-pascal wrote: On Sun, Nov 19, 2023 at 3:50 PM Bart wrote: Thanks again for testing. What about ['c:','a','b'] Does it return c:a\b, or c:\a\b (on Windows), or IOW: does it take into account driveletters? The first one IMO would be correct. It returns

Re: [fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?y

2023-11-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Nov 2023, Bart via fpc-pascal wrote: On Sun, Nov 19, 2023 at 2:31 PM Michael Van Canneyt via fpc-pascal wrote: > This raises the question what the result of > TPath.Combine(['a','\b',c'','\d','e']) would be (I would then expect > either \b\c or \d\

Re: [fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?y

2023-11-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Nov 2023, Bart via fpc-pascal wrote: On Sun, Nov 19, 2023 at 12:59 PM Michael Van Canneyt via fpc-pascal wrote: The output is in linux.txt and windows.txt Thanks for testing. It seems that it'll pick the last absolute path it finds, not the first one in the argument list

Re: [fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?

2023-11-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Nov 2023, Bart via fpc-pascal wrote: On Sun, Nov 19, 2023 at 11:04 AM Sven Barth via fpc-pascal wrote: Also: does this depend on the operating system and/or file system? Cause Linux file systems have different invalid characters (usually only slash and NUL) than NTFS or FAT.

Re: [fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?

2023-11-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Nov 2023, Sven Barth via fpc-pascal wrote: Bart via fpc-pascal schrieb am Sa., 18. Nov. 2023, 18:24: 1. The docs state that an exception is raised if the given paths contain invalid characters. Does the vlaue of the ValidateParams have any influence on this? Also: does this

Re: [fpc-pascal] fcl-web websocket

2023-11-09 Thread Michael Van Canneyt via fpc-pascal
On Wed, 8 Nov 2023, k1 via fpc-pascal wrote: Hi guys, do somone know how to enable ssl with the websocket semod fcl-web/examples/websocket/server/wsserver fcl-web/examples/websocket/client/wsclient the client working fine with a node websocket server, with just one command more

Re: [fpc-pascal] Difference between string and Tbytes as procedure arguments?

2023-11-05 Thread Michael Van Canneyt via fpc-pascal
On Sun, 5 Nov 2023, Bo Berglund via fpc-pascal wrote: You must copy the data. The copy() function can be used for this. Follow-up question: Can I change the function declaration like this and preserve the content? function TSSConnection.ParseCmdFileData(var SSCmdFile: TSSCommandFile;

Re: [fpc-pascal] Difference between string and Tbytes as procedure arguments?

2023-11-05 Thread Michael Van Canneyt via fpc-pascal
On Sun, 5 Nov 2023, Bo Berglund via fpc-pascal wrote: I am maintaining an old utility program that started out about 20+ years ago using Delphi7. The utility communicates via RS232 with a measuring system in order to retrieve and process recorded data and at the time this was started I used

Re: [fpc-pascal] fcl-pdf custom font from memstream

2023-11-02 Thread Michael Van Canneyt via fpc-pascal
On Thu, 2 Nov 2023, Mattias Gaertner via fpc-pascal wrote: On 02.11.23 14:00, Michael Van Canneyt via fpc-pascal wrote: On Thu, 2 Nov 2023, Alexey Torgashin via fpc-pascal wrote: How to load a custom font from a stream instead of from a file? Currently no way to my knowledge

Re: [fpc-pascal] fcl-pdf custom font from memstream

2023-11-02 Thread Michael Van Canneyt via fpc-pascal
On Thu, 2 Nov 2023, Alexey Torgashin via fpc-pascal wrote: How to load a custom font from a stream instead of from a file? Currently no way to my knowledge, But fpparsettf.pp has this: TTFFileInfo = class(TObject) ... public // Load a TTF file from file or stream. Procedure

Re: [fpc-pascal] fcl-pdf custom font from memstream

2023-11-02 Thread Michael Van Canneyt via fpc-pascal
On Thu, 2 Nov 2023, Mattias Gaertner via fpc-pascal wrote: Hi, How to load a custom font from a stream instead of from a file? Currently no way to my knowledge, but I am open for patches ! Michael. ___ fpc-pascal maillist -

Re: [fpc-pascal] IDispatch with Variant is not working on Linux. Why?

2023-11-01 Thread Michael Van Canneyt via fpc-pascal
On Wed, 1 Nov 2023, Anthony Walter via fpc-pascal wrote: Thank you Micahel, I was doing some research last night and found that there are two specific stubs in the System unit that are implemented by the ComObj unit. Specifically, a stub for safe call exception handling and dispatch invoke.

Re: [fpc-pascal] IDispatch with Variant is not working on Linux. Why?

2023-11-01 Thread Michael Van Canneyt via fpc-pascal
On Tue, 31 Oct 2023, Anthony Walter via fpc-pascal wrote: Is there any reason why the late binding of properties and methods through of IDispatch interface with the Variant type is not working on Linux? Variant dispatching requires OS bindings. They are enabled when the ComObj unit is

Re: [fpc-pascal] [Lazarus] Running FPC in the browser...

2023-10-29 Thread Michael Van Canneyt via fpc-pascal
On Sat, 28 Oct 2023, Wayne Sherman via fpc-pascal wrote: On Sun, Oct 22, 2023 at 3:20 AM Michael Van Canneyt wrote: Thanks to the efforts of Nikolay Nikolov, the FPC compiler can now recompile itself to webassembly I just watched an interesting talk from StrangeLoop called: "I

[fpc-pascal] Running FPC in the browser...

2023-10-22 Thread Michael Van Canneyt via fpc-pascal
Hello, Thanks to the efforts of Nikolay Nikolov, the FPC compiler can now recompile itself to webassembly (the support for the goto statement made this possible). As a consequence, this means FPC can now be run in a browser. See the screenshot at

Re: [fpc-pascal] All methods vitrual ?

2023-10-16 Thread Michael Van Canneyt via fpc-pascal
On Mon, 16 Oct 2023, Adriaan van Os via fpc-pascal wrote: That's absurd, there are many features in modes objfpc and macpas that don't compile with Delphi. That doesn't make it any less true. Also we won't add it anyway, so... 路‍♀️ Apperently, a sensible discussion, based on

Re: [fpc-pascal] What is webasssembly?

2023-10-12 Thread Michael Van Canneyt via fpc-pascal
On Wed, 11 Oct 2023, Steve Litt via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal said on Wed, 11 Oct 2023 08:27:35 +0200 (CEST) On Tue, 10 Oct 2023, Steve Litt via fpc-pascal wrote: What is webasssembly? A bytecode format (similar to what is used in Java and C# runtimes) which

Re: [fpc-pascal] All methods vitrual ?

2023-10-11 Thread Michael Van Canneyt via fpc-pascal
On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal wrote: $M controls the inclusion of RTTI, i.e. it allows or disallows the use of the published section. No more, no less. I don't see any use in allowing or disallowing something

Re: [fpc-pascal] All methods vitrual ?

2023-10-11 Thread Michael Van Canneyt via fpc-pascal
On Wed, 11 Oct 2023, Adriaan van Os via fpc-pascal wrote: Sven Barth via fpc-pascal wrote: Ah, yes, only classes and interfaces can be used for published fields. For properties anything is allowed. However, what makes the whole thing unuseable is that with {$M-} the compiler doesn't

Re: [fpc-pascal] What is webasssembly?

2023-10-11 Thread Michael Van Canneyt via fpc-pascal
On Tue, 10 Oct 2023, Steve Litt via fpc-pascal wrote: What is webasssembly? A bytecode format (similar to what is used in Java and C# runtimes) which is an open standard and which runs in all major browsers or in a host application. Michael. ___

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Michael Van Canneyt via fpc-pascal
On Mon, 9 Oct 2023, Adriaan van Os via fpc-pascal wrote: Is there a trick to make (in mode macpas) all class methods implicitely virtual ? I mean, without adding the virtual keyword to all of them ? The reason is that I want to create a tree view of the class hierarchy with all the method

Re: [fpc-pascal] fpc webassembly and node

2023-10-09 Thread Michael Van Canneyt via fpc-pascal
On Mon, 9 Oct 2023, Michael Van Canneyt via fpc-pascal wrote: Hello, Either list is fine. This should compile and work. I'm using webassembly and classes quite a lot, even with threading, so I see no reason why this simple code should not run. How did you start the webassembly ? How

Re: [fpc-pascal] fpc webassembly and node

2023-10-09 Thread Michael Van Canneyt via fpc-pascal
Hello, Either list is fine. This should compile and work. I'm using webassembly and classes quite a lot, even with threading, so I see no reason why this simple code should not run. How did you start the webassembly ? How much memory did you provide to the webassembly ? Did you use

Re: [fpc-pascal] Issue #39746 fpwidestring case conversion string too long

2023-09-27 Thread Michael Van Canneyt via fpc-pascal
On Mon, 25 Sep 2023, Tony Whyman via fpc-pascal wrote: This issue seems to be still open after one year. There was a proposed fix: https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/158. However the discussion seems to tail off without an obvious resolution. This is a clear bug

Re: [fpc-pascal] Closure hangs compiler

2023-09-24 Thread Michael Van Canneyt via fpc-pascal
On Sun, 24 Sep 2023, Hairy Pixels via fpc-pascal wrote: This program hangs during compiling. Does this happen to you too? I can confirm. Please create a bugreport. Michael. === Free Pascal Compiler version 3.3.1 [2023/03/03] for

Re: [fpc-pascal] SeekEof issue & 2020 blog post by A Stolyarov

2023-09-11 Thread Michael Van Canneyt via fpc-pascal
On Mon, 11 Sep 2023, Tomas Hajny via fpc-pascal wrote: On 2023-09-11 11:08, Alexey Torgashin via fpc-pascal wrote: Translation of blog post http://www.stolyarov.info/node/290 from Ru to En. Sep 6 2020. Author: Andrey Stolyarov, author of Ru books about programming. . . Q (reader): Judging

Re: [fpc-pascal] Visual studio code

2023-08-11 Thread Michael Van Canneyt via fpc-pascal
On Fri, 11 Aug 2023, Darius Blaszyk via fpc-pascal wrote: Quick question for you all. Has anyone here worked with Visual Studio Code for Free Pascal? I've got the Free Pascal Toolkit plugin up and running, but I'm hitting a bit of a roadblock with setting up GDB debugging. After

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Michael Van Canneyt via fpc-pascal
On Thu, 10 Aug 2023, Hairy Pixels via fpc-pascal wrote: On Aug 10, 2023, at 4:23 PM, Hairy Pixels wrote: // 4) subscript (inc and dereference in one step) v := i[1]; #4 was not in the list for example so I wonder what others exist. I found another one in the typinfo.pp unit. What

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Michael Van Canneyt via fpc-pascal
On Thu, 10 Aug 2023, Hairy Pixels via fpc-pascal wrote: On Aug 10, 2023, at 10:49 AM, Sven Barth via fpc-pascal wrote: Then you simply aren't using them often enough. E.g. the RTTI internal code is full of them and additional typecasts would simply muddle up otherwise relatively

Re: [fpc-pascal] TStringHelper not found

2023-07-24 Thread Michael Van Canneyt via fpc-pascal
On Mon, 24 Jul 2023, Rafael Picanço via fpc-pascal wrote: I just updated to trunk (Lazarus 3.99 4ed7ff9b1c, FPC 3.3.1-13378-gceddc2aec3) and I am getting an "Identifier not found" error for TStringHelper: I introduced an alias. Michael.___

Re: [fpc-pascal] Documentation or compiler bug?

2023-07-08 Thread Michael Van Canneyt via fpc-pascal
On Sat, 8 Jul 2023, Michael Van Canneyt via fpc-pascal wrote: On Sat, 8 Jul 2023, Hairy Pixels via fpc-pascal wrote: In fact I filed a bug today which was related. Notice how I didn't use cdecl in the program but another user tried to compile and had problems with cdecl also. https

Re: [fpc-pascal] Documentation or compiler bug?

2023-07-08 Thread Michael Van Canneyt via fpc-pascal
On Sat, 8 Jul 2023, Hairy Pixels via fpc-pascal wrote: In fact I filed a bug today which was related. Notice how I didn't use cdecl in the program but another user tried to compile and had problems with cdecl also. https://gitlab.com/freepascal.org/fpc/source/-/issues/40342

Re: [fpc-pascal] Documentation or compiler bug?

2023-07-08 Thread Michael Van Canneyt via fpc-pascal
On Sat, 8 Jul 2023, Hairy Pixels via fpc-pascal wrote: I get the error "Procedure directive "CDECL" cannot be used with "EXTERNAL"" when I use "cdecl" with external modifiers yet the docs at https://www.freepascal.org/docs-html/ref/refsu73.html say": When compiling this, and linking to the

Re: [fpc-pascal] reverse for in loop

2023-07-07 Thread Michael Van Canneyt via fpc-pascal
On Fri, 7 Jul 2023, Zamrony P. Juhara via fpc-pascal wrote: I like simplicity for .. in .. loop. but is there equivalent for reverse loop? If you code your enumerator so then yes. For standard types there is none. Michael. ___ fpc-pascal

Re: [fpc-pascal] Pchar from constant string

2023-06-30 Thread Michael Van Canneyt via fpc-pascal
On Fri, 30 Jun 2023, Michael Van Canneyt via fpc-pascal wrote: On Fri, 30 Jun 2023, Hairy Pixels via fpc-pascal wrote: On Jun 30, 2023, at 9:03 AM, Hairy Pixels wrote: That's why that worked. Hmm with short strings the null terminator could be truncated when copying right

Re: [fpc-pascal] Pchar from constant string

2023-06-30 Thread Michael Van Canneyt via fpc-pascal
On Fri, 30 Jun 2023, Hairy Pixels via fpc-pascal wrote: On Jun 30, 2023, at 9:03 AM, Hairy Pixels wrote: That's why that worked. Hmm with short strings the null terminator could be truncated when copying right? Something to look out for. this is what I meant about truncation. S is no

Re: [fpc-pascal] Pchar from constant string

2023-06-29 Thread Michael Van Canneyt via fpc-pascal
On Thu, 29 Jun 2023, Mattias Gaertner via fpc-pascal wrote: On Thu, 29 Jun 2023 21:18:44 +0700 Hairy Pixels via fpc-pascal wrote: What is really happening in this snippet? I think it must be implicitly taking the address of the constant string but is it also adding the null terminator

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-27 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, Steve Litt via fpc-pascal wrote: Steve Litt via fpc-pascal said on Mon, 26 Jun 2023 22:26:17 -0400 Where does one get ComObj? On my box this errored out with: I went off half cocked. I'm using Linux. Is ComObj even available on Linux? Would you expect Voice :=

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, Marco van de Voort via fpc-pascal wrote: On 26-6-2023 20:26, Michael Van Canneyt via fpc-pascal wrote: I suspect COM is not properly initialized, and that Lazarus does this for you. (it needs com for some components on windows) So, try adding unit windows

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, Michael Van Canneyt via fpc-pascal wrote: On Mon, 26 Jun 2023, James Richters wrote: I tried to make your example into a FPC program without Lazarus: {$mode objfpc}{$H+} uses comobj; var SavedCW: Word; v: OleVariant; begin v:=CreateOleObject('SAPI.SpVoice

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, James Richters wrote: I tried to make your example into a FPC program without Lazarus: {$mode objfpc}{$H+} uses comobj; var SavedCW: Word; v: OleVariant; begin v:=CreateOleObject('SAPI.SpVoice'); v.Speak('Hello'); End. I get: Running

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, Travis Siegel via fpc-pascal wrote: Thank you, this one works for me with a command line compile.  I compared the two programs, and the line that asks for the voices is the culprit. I'll have to do some digging to see why that line breaks the runtime execution. Try

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Mon, 26 Jun 2023, Marco van de Voort via fpc-pascal wrote: On 26-6-2023 15:54, Michael Van Canneyt via fpc-pascal wrote:   v.Voice:=v.GetVoices().Item(1); I have to change that to (0) to get it to work. Might depend on configuration? Probably the number of voices installed

Re: [fpc-pascal] Microsoft SAPI on Freepascal

2023-06-26 Thread Michael Van Canneyt via fpc-pascal
On Sun, 25 Jun 2023, James Richters via fpc-pascal wrote: I gave up on doing it directly, it seems SO convoluted to do with FPC with the COM unit and all this stuff I just don’t understand, and it’s SO simple to do with a VBS script in just 3 lines and it just works! (it would only be 2

Re: [fpc-pascal] Parse JSON

2023-06-25 Thread Michael Van Canneyt via fpc-pascal
On Fri, 23 Jun 2023, Darius Blaszyk via fpc-pascal wrote: Hi all, I've hardly done anything with JSON in Freepascal before, so apologies for the trivial question. I want to traverse an array in JSON and retrieve the elements (which I don't know what they are in advance) one by one. An

  1   2   3   4   5   6   7   8   9   10   >