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

2022-09-08 Thread Michael Van Canneyt via fpc-pascal
On Thu, 8 Sep 2022, Hairy Pixels via fpc-pascal wrote: On Sep 8, 2022, at 9:09 AM, Michael Van Canneyt wrote: To me it seems logical that you cannot do this, since a function reference is actually an interface, and there is no actual object to back it up. Your function reference could

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

2022-09-08 Thread Michael Van Canneyt via fpc-pascal
On Thu, 8 Sep 2022, Hairy Pixels via fpc-pascal wrote: A function reference can call a class method but can you get the TMethod data from function references? It was possible with “is object” to cast to TMethod but that doesn’t seem to be possible with references. = type TMyClass

Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-09-01 Thread Michael Van Canneyt via fpc-pascal
On Thu, 1 Sep 2022, Anthony Walter via fpc-pascal wrote: For those having problems downloading the solution, here is an alternate link: https://cache.getlazarus.org/chipmunktest.7z Thank you, this works admirably. Michael. ___ fpc-pascal maillis

Re: [fpc-pascal] I am offering a $100 reward for linking static libraries

2022-08-31 Thread Michael Van Canneyt via fpc-pascal
On Wed, 31 Aug 2022, Anthony Walter via fpc-pascal wrote: I wanted everyone to know that after two attempts user Okoba on the Lazarus general forums was able to come up with a solution to fix this problem. I created a small demo that simulates objects dropped into an area with pegs rendered o

Re: [fpc-pascal] BoolToStr

2022-08-29 Thread Michael Van Canneyt via fpc-pascal
On Mon, 29 Aug 2022, James Richters via fpc-pascal wrote: Thanks for the discussion everyone, it does shed some light on what's going on. I agree it would be impossible to change it now, It was actually a GREAT idea to make it customizable, and that serves my needs just fine. I guess all th

Re: [fpc-pascal] BoolToStr

2022-08-28 Thread Michael Van Canneyt via fpc-pascal
On Sun, 28 Aug 2022, James Richters via fpc-pascal wrote: I'm curious if there is a way to search the FPC version history of changes for BoolToStr to see why it was changed, and see if there is a valid reason not to change it back. it was obviously changed from the way the documentations is

Re: [fpc-pascal] BoolToStr

2022-08-28 Thread Michael Van Canneyt via fpc-pascal
On Sun, 28 Aug 2022, James Richters via fpc-pascal wrote: I'm generating a report where I wish to display some Boolean values. I thought I would try BoolToStr, as according to: https://www.freepascal.org/docs-html/rtl/sysutils/booltostr.html it states: Description BoolToStr converts the boo

Re: [fpc-pascal] Teaching Kids Using Free Pascal

2022-08-27 Thread Michael Van Canneyt via fpc-pascal
On Sat, 27 Aug 2022, Anthony Walter via fpc-pascal wrote: Some of you might not be aware, but I teach small groups of kids ages 8-16 computer programming and digital electronics. When teaching programming I often use Free Pascal and Lazarus, and try to come up with exciting ideas. Over the p

Re: [fpc-pascal] TFPHTTPServer and HTTPS

2022-08-24 Thread Michael Van Canneyt via fpc-pascal
On Wed, 24 Aug 2022, Alexey Torgashin via fpc-pascal wrote: You need to set your certificate details as well: fServer.UseSSL := fUseSSL; I just saved this info to wiki: https://wiki.freepascal.org/fphttpserver#Support_for_HTTPS Thank you. I added some more detail. Michael. ___

Re: [fpc-pascal] TFPHTTPServer and HTTPS

2022-08-23 Thread Michael Van Canneyt via fpc-pascal
On Tue, 23 Aug 2022, Fabio Luis Girardi via fpc-pascal wrote: Exists in FPC some example that demonstrates the use of TFPHTTPServer with HTTPS? The unique example that I have found is about TCustomHTTPApplication. There is no separate example. Using https is just setting a property UseSSL

Re: [fpc-pascal] Union followed by Property does not compile !

2022-08-02 Thread Michael Van Canneyt via fpc-pascal
On Mon, 1 Aug 2022, Skybuck Flying via fpc-pascal wrote: } {$mode objfpc}{$H+} You need additionally a modeswitch for advanced records, or properties in records will not work: {$modeswitch advancedrecords} // UNION example case integer of   0 : ( m

Re: [fpc-pascal] Here is real time graphics and physics simulation, library

2022-08-01 Thread Michael Van Canneyt via fpc-pascal
On Mon, 1 Aug 2022, Ingemar Ragnemalm via fpc-pascal wrote: Den 2022-08-01 kl. 09:40, skrev fpc-pascal-requ...@lists.freepascal.org: Date: Sun, 31 Jul 2022 09:05:56 -0400 From: Anthony Walter Michael, it's the same logic behind my now 12 year old Bare game system that did the exact same t

Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Michael Van Canneyt via fpc-pascal
On Sun, 31 Jul 2022, Anthony Walter via fpc-pascal wrote: Michael, Since there are many things you do not provide but which are needed in real-world programs, that makes it de facto useless. This library is intended for fast 2D/3D animated graphics with 2D physics simulations. These can b

Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Michael Van Canneyt via fpc-pascal
On Sun, 31 Jul 2022, Anthony Walter wrote: Michael, it's the same logic behind my now 12 year old Bare game system that did the exact same thing. I am creating a small lPascal ibrary that removes a lot of cruft and depends minimally on SDL for creating windows, managing input, handling sound,

Re: [fpc-pascal] Here is real time graphics and physics simulation library

2022-07-31 Thread Michael Van Canneyt via fpc-pascal
On Sun, 31 Jul 2022, Anthony Walter via fpc-pascal wrote: I am looking for help adding in a bunch more features to my real time graphics and physics simulation library. Here is a very brief overview with some screenshots and sources. https://github.com/sysrpl/Tiny.Sim I need help finishing

Re: [fpc-pascal] Are there any drawbacks to "reference to"?

2022-06-20 Thread Michael Van Canneyt via fpc-pascal
On Mon, 20 Jun 2022, Hairy Pixels via fpc-pascal wrote: On Jun 20, 2022, at 12:44 PM, Sven Barth wrote: If the compiler can proove that the function reference never leaves the scope (that means no assignment to global variables, out/var parameters, the Result variable, passing on to som

Re: [fpc-pascal] Are there any drawbacks to "reference to"?

2022-06-20 Thread Michael Van Canneyt via fpc-pascal
On Mon, 20 Jun 2022, Sven Barth wrote: Michael Van Canneyt schrieb am Mo., 20. Juni 2022, 08:04: On Mon, 20 Jun 2022, Sven Barth via fpc-pascal wrote: Am 20.06.2022 um 03:37 schrieb Hairy Pixels: On Jun 19, 2022, at 10:04 PM, Sven Barth wrote: As you can see the allocation only

Re: [fpc-pascal] Are there any drawbacks to "reference to"?

2022-06-19 Thread Michael Van Canneyt via fpc-pascal
On Mon, 20 Jun 2022, Sven Barth via fpc-pascal wrote: Am 20.06.2022 um 03:37 schrieb Hairy Pixels: On Jun 19, 2022, at 10:04 PM, Sven Barth wrote: As you can see the allocation only happens once and not all the time. What might be worse however is the optimization behavior as in this e

Re: [fpc-pascal] "Is nested" vs "of object" compatibility with global functions

2022-05-28 Thread Michael Van Canneyt via fpc-pascal
On Sun, 29 May 2022, Hairy Pixels via fpc-pascal wrote: I’ve been testing out all the different function pointer types in FPC to test their compatibility with each other and I noticed that “is nested” can accept a global function declaration but “of object” can not. What is the reason for thi

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

2022-05-28 Thread Michael Van Canneyt via fpc-pascal
On Sat, 28 May 2022, Hairy Pixels via fpc-pascal wrote: On May 28, 2022, at 2:06 PM, Michael Van Canneyt via fpc-pascal wrote: Ah... The desire to make a programming language terse and unreadable as a consequence. If you want that, use C#, Javascript or one of the ubiquitous languages

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

2022-05-28 Thread Michael Van Canneyt via fpc-pascal
On Sat, 28 May 2022, Hairy Pixels via fpc-pascal wrote: I’ve had some time to play with this now and my first piece of feedback is that given my experience with other languages, the most common usage of closures is by passing them as arguments to functions. Compared to the other languages I

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

2022-05-26 Thread Michael Van Canneyt via fpc-pascal
Hello ! Nice job, kudos both for Blaise and Sven, and special thanks to Zoë Peterson for donating the code to FPC, as Scooter Software sponsored the initial work by Blaise. I'm glad to see that the FPC implementation makes the distinction between function references and anonymous functions ve

Re: [fpc-pascal] Element type of set at compile time

2022-05-15 Thread Michael Van Canneyt via fpc-pascal
On Sun, 15 May 2022, Martin Frb via fpc-pascal wrote: On 15/05/2022 15:07, Hairy Pixels via fpc-pascal wrote: var I: ElementType(TMySet); begin for i := low(TMySet) to high(TMySet) do ; type   TMySet = set of (one,two,three); var   I: low(TMySet) .. high(TMySet) ; begin   for i :

Re: [fpc-pascal] Element type of set at compile time

2022-05-15 Thread Michael Van Canneyt via fpc-pascal
On Sun, 15 May 2022, Hairy Pixels via fpc-pascal wrote: Is there a compiler intrinsic to get the element type of a set at compile time? So if you have “set of T” it should return T. I don't think you can make such an intrinsic. This type does not always exist, since you can define Type

Re: [fpc-pascal] alloca

2022-05-13 Thread Michael Van Canneyt via fpc-pascal
On Sat, 14 May 2022, Hairy Pixels via fpc-pascal wrote: On May 13, 2022, at 11:08 PM, Michael Van Canneyt via fpc-pascal wrote: Is there an “alloca" like function in the RTL which allocates memory from the stack? For example https://man7.org/linux/man-pages/man3/alloca.3.html

Re: [fpc-pascal] alloca

2022-05-13 Thread Michael Van Canneyt via fpc-pascal
On Fri, 13 May 2022, Hairy Pixels via fpc-pascal wrote: Is there an “alloca" like function in the RTL which allocates memory from the stack? For example https://man7.org/linux/man-pages/man3/alloca.3.html No such function exists in FPC. Michael._

Re: [fpc-pascal] Improve TStringList.Text setter?

2022-05-05 Thread Michael Van Canneyt via fpc-pascal
On Thu, 5 May 2022, Alexey Torgashin via fpc-pascal wrote: (I posted to the forum, but it's better to post here.) TStringList.Text setter does this Procedure TStrings.DoSetTextStr(const Value: string; DoClear : Boolean); ... if FLineBreak=sLineBreak then begin Wh

Re: [fpc-pascal] Correct way for using TThread.ForceQueue?

2022-04-25 Thread Michael Van Canneyt via fpc-pascal
On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote: I cannot remember why, but a long time ago when learning Delphi 5 or 6, I have learned not to call the destructor from within any method of the class, only from outside. If this is no longer true nowadays (or maybe, has never been true b

Re: [fpc-pascal] Correct way for using TThread.ForceQueue?

2022-04-25 Thread Michael Van Canneyt via fpc-pascal
On Mon, 25 Apr 2022, Thomas Kurz via fpc-pascal wrote: This is a very elegant solution but it can only be used for Synchronize, right? Because with ForceQueue I cannot know when it's done and freeing within Run (i.e. "Self.Free") would fail. Why would this fail according to you ? I have

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-21 Thread Michael Van Canneyt via fpc-pascal
On Fri, 22 Apr 2022, Hairy Pixels via fpc-pascal wrote: If you want to pass a pointer to ^T in a generic function is there anyway safe to do this currently? Pascal doesn’t allow ^ types in function arguments (why?) Because it is a type definition and you can't put type definition in a functi

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-21 Thread Michael Van Canneyt via fpc-pascal
On Thu, 21 Apr 2022, Hairy Pixels via fpc-pascal wrote: On Apr 21, 2022, at 3:48 AM, Mattias Gaertner via fpc-pascal wrote: Writeln(Apply(@StrFunc, 'Foobar')); // will write FOOBAR Writeln(Apply(@NegFunc, 42)); // will write -42 end. Mind boggling. :) This was actually your idea if

Re: [fpc-pascal] Compiler internals. Changing dynamic arrays format

2022-04-13 Thread Michael Van Canneyt via fpc-pascal
On Wed, 13 Apr 2022, denisgolovan via fpc-pascal wrote: On 2022-04-13 00:34, denisgolovan via fpc-pascal wrote: Your comment about conditional defines goes in the right direction - basically: 1) Separate your changes into parts affecting the compiler behaviour (e.g. the changes impacti

Re: [fpc-pascal] RTLEventWaitFor

2022-04-05 Thread Michael Van Canneyt via fpc-pascal
On Tue, 5 Apr 2022, Mattias Gaertner via fpc-pascal wrote: On Tue, 5 Apr 2022 10:23:45 +0200 (CEST) Michael Van Canneyt via fpc-pascal wrote: [...] RTLEventWaitFor uses WaitForSingleObject internally. According to this: https://docs.microsoft.com/en-gb/windows/win32/sync/wait-functions

Re: [fpc-pascal] RTLEventWaitFor

2022-04-05 Thread Michael Van Canneyt via fpc-pascal
On Tue, 5 Apr 2022, Mattias Gaertner via fpc-pascal wrote: Hi Michael, Under Linux a RTLEventWaitFor(e,1) usually waits at most 1ms. But under Windows it usually waits at least 15ms. It seems to round to nearest 1/64 of a second. Googling this lead me to question the sanity of some bloggers

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-28 Thread Michael Van Canneyt via fpc-pascal
On Mon, 28 Mar 2022, Alexey Torgashin via fpc-pascal wrote: Currently if I run "extractcssclasses" with Bootstrap 4 (or 5) CSS file (not minified) I get it work for more than 30 seconds, then I stopped it, too long. Correct, there was an infinite loop. Is now fixed. Michael. _

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-28 Thread Michael Van Canneyt via fpc-pascal
On Mon, 28 Mar 2022, Michael Van Canneyt via fpc-pascal wrote: On Mon, 28 Mar 2022, Alexey Torgashin via fpc-pascal wrote: I will add some options to interpret "*zoom" as a property name, but they will off by default. OK thanks. Can you try now with CSS (usual or minified)

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-28 Thread Michael Van Canneyt via fpc-pascal
On Mon, 28 Mar 2022, Alexey Torgashin via fpc-pascal wrote: I will add some options to interpret "*zoom" as a property name, but they will off by default. OK thanks. Can you try now with CSS (usual or minified) from https://getbootstrap.com/ ? See 'download' which gives file bootstrap-5.1.3

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-27 Thread Michael Van Canneyt via fpc-pascal
On Sun, 27 Mar 2022, Michael Van Canneyt via fpc-pascal wrote: On Sun, 27 Mar 2022, Alexey Torgashin via fpc-pascal wrote: "*zoom", really ? That's not even valid CSS syntax. I checked 2 EBNF grammars: neither will allow this. I checked the W3 spec: Confirms this is s

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-27 Thread Michael Van Canneyt via fpc-pascal
On Sun, 27 Mar 2022, Alexey Torgashin via fpc-pascal wrote: "*zoom", really ? That's not even valid CSS syntax. I checked 2 EBNF grammars: neither will allow this. I checked the W3 spec: Confirms this is simply not valid syntax. But "*.nnn" is valid one. https://css-tricks.com/almanac/sele

Re: [fpc-pascal] New FCL-CSS package in the GitLab repo

2022-03-27 Thread Michael Van Canneyt via fpc-pascal
On Sun, 27 Mar 2022, Alexey Torgashin via fpc-pascal wrote: @Michael Van Canneyt I didn't test but I hope this package can parse this _minified_ CSS file? Minified or not is normally not relevant for parsing. Attached on the forum https://forum.lazarus.freepascal.org/index.php/topic,5885

Re: [fpc-pascal] Just out of curiosity: Compiling FPC trunk and fpcmake

2022-03-21 Thread Michael Van Canneyt via fpc-pascal
On Mon, 21 Mar 2022, Victor Campillo via fpc-pascal wrote: Hi, For years I have been using the same script to compile FPC, I have multiple version of FPC installed in the same machine, mainly my script do: make -j 9 clean all make -j 9 all install FPMAKEOPT="-T 9" INSTALL_PREFIX=.../fpc

Re: [fpc-pascal] JSON RPC on Mac M1 fails

2022-03-09 Thread Michael Van Canneyt via fpc-pascal
On Thu, 10 Mar 2022, Hairy Pixels via fpc-pascal wrote: On Mar 9, 2022, at 10:48 PM, Michael Van Canneyt via fpc-pascal wrote: It breaks early on when sending the first message (initialize) which I register like this: JSONRPCHandlerManager.RegisterHandler('initi

Re: [fpc-pascal] JSON RPC on Mac M1 fails

2022-03-09 Thread Michael Van Canneyt via fpc-pascal
On Wed, 9 Mar 2022, Hairy Pixels via fpc-pascal wrote: I don’t know where to start debugging this yet but I found that compiling for the aarch64 target now breaks my Pascal language server which uses JSON RPC. It breaks early on when sending the first message (initialize) which I register li

Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Michael Van Canneyt via fpc-pascal
On Mon, 21 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 21, 2022, at 7:01 PM, Michael Van Canneyt via fpc-pascal wrote: Yes, this is testbit. Why do you say it does not work ? Oh my, I was confusing my terms I think. I wanted to do bit masking (I think it's called).

Re: [fpc-pascal] Bit manipulation helpers

2022-02-21 Thread Michael Van Canneyt via fpc-pascal
On Mon, 21 Feb 2022, Ryan Joseph via fpc-pascal wrote: I tried to use the bit helpers like https://www.freepascal.org/docs-html/rtl/sysutils/twordhelper.testbit.html but the bit to test is 0..15. There are only 16 bits in a word, so that is correct. I expected this to work like https://wi

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, James Richters wrote: Thanks for the elegant solution Michael, but I'm having some issues implementing it. I'm getting: pastep.pas(28651,10) Warning: Function result does not seem to be set 28650 // Custom compare function 28651 function CompareValues(List: TStringLi

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Michael Van Canneyt via fpc-pascal wrote: On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal wrote: It's relatively "easy" to implement assigning a nested function to function refe

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 15, 2022, at 8:26 PM, Sven Barth via fpc-pascal wrote: It's relatively "easy" to implement assigning a nested function to function references. However assigning a nested function variable to a function reference is much hard

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 15, 2022, at 3:32 PM, Michael Van Canneyt via fpc-pascal wrote: I requested that this: procedure TMyObject.Demo; Procedure DoSub; begin Writeln('Sub'); end; begin DoTest(DoSub); end; So that means &qu

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 15, 2022, at 2:09 PM, Michael Van Canneyt via fpc-pascal wrote: I've answered this question before: The "Reference to procedure" that will be part of anonymous functionswill do this for you. I'm sorry

Re: [fpc-pascal] Caller agnostic procedure variables

2022-02-14 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, Ryan Joseph via fpc-pascal wrote: This has been a constant problem for me with FPC and wanted to make a formal post with code examples since I've only mentioned it in passing before. How can it be achieved to have a caller agnostic procedure variables? I've tried making

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Feb 2022, James Richters via fpc-pascal wrote: Is there a quick way to sort a stringlist on it's .ValueFromIndex field instead of it's .Names field? // Custom compare function function CompareValues(List: TStringList; Index1, Index2: Integer): Integer; begin Result:=Compar

Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal
On Sun, 13 Feb 2022, Sven Barth via fpc-pascal wrote: Personally, I would not allow this. But Delphi compiles and runs it... ... and Delphi's class completion no longer works in the unit giving a useless error "expected ';' but '.' found". So it is one of those Delphi "features" compiling bu

Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal
On Sun, 13 Feb 2022, Mattias Gaertner via fpc-pascal wrote: On Sat, 12 Feb 2022 12:14:14 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote: > Hi, > > This can't be right, can it? > > type > TBird = c

Re: [fpc-pascal] bug or feature?

2022-02-13 Thread Michael Van Canneyt via fpc-pascal
On Sun, 13 Feb 2022, Ryan Joseph via fpc-pascal wrote: On Feb 12, 2022, at 11:40 PM, Jonas Maebe via fpc-pascal wrote: I wouldn't consider this to be working by design, but rather because of implementation limitations. I agree and it should be fixed probably. As I wrote in my initia

Re: [fpc-pascal] bug or feature?

2022-02-12 Thread Michael Van Canneyt via fpc-pascal
On Sat, 12 Feb 2022, Jonas Maebe via fpc-pascal wrote: On 12/02/2022 17:36, Michael Van Canneyt via fpc-pascal wrote: PS. Just tested, the compiler accepts both... Amazing, I never thought this would be possible. I'd better update the docs :-) I wouldn't consider this to be

Re: [fpc-pascal] bug or feature?

2022-02-12 Thread Michael Van Canneyt via fpc-pascal
On Sat, 12 Feb 2022, Sven Barth via fpc-pascal wrote: Michael Van Canneyt via fpc-pascal schrieb am Sa., 12. Feb. 2022, 12:14: On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote: Hi, This can't be right, can it? type TBird = class procedure Fly; end; TEagle =

Re: [fpc-pascal] bug or feature?

2022-02-12 Thread Michael Van Canneyt via fpc-pascal
On Sat, 12 Feb 2022, Mattias Gaertner via fpc-pascal wrote: Hi, This can't be right, can it? type TBird = class procedure Fly; end; TEagle = TBird; // alias procedure TEagle.Fly; begin end; Personally, I would not allow this. But Delphi compiles and runs it... Maybe something to

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread Michael Van Canneyt via fpc-pascal
On Mon, 7 Feb 2022, James Richters via fpc-pascal wrote: Strange, I have it here ? Maybe it was introduced later... Maybe I need to use another unit? No. :-( It exists on TCSVParser only, not on TCSVDocument. That's a pity, because TCSVDocument should to pass it on to the TCSVParser. I

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread Michael Van Canneyt via fpc-pascal
On Mon, 7 Feb 2022, James Richters wrote: I tried this: CSVData:=TCSVDocument.Create; CSVData.DetectBOM := True; CSVData.LoadFromFile(ParamStr(1)); Writeln('Read In: ',CSVData.RowCount,' Rows and ',CSVData.MaxColCount,' Columns');

Re: [fpc-pascal] Issue with CSVDocument

2022-02-07 Thread Michael Van Canneyt via fpc-pascal
Hello, Sounds like you have a BOM marker in the file. Set CSVDocument.DetectBOM := True; Michael. On Mon, 7 Feb 2022, James Richters via fpc-pascal wrote: I have CSVDocument working, but something odd is happening. Everything is coming out as I expect, Except for the first cell.. it has

Re: [fpc-pascal] Putting Delimited text into a StringList

2022-02-06 Thread Michael Van Canneyt via fpc-pascal
On Sun, 6 Feb 2022, James Richters via fpc-pascal wrote: I'm trying to get Comma Delimited Text from a CSV File created with Microsoft Excel into a string list, but I keep getting spaces as delimiter characters. How can I prevent this and use ONLY commas as delimiters? I hardcoded a test stri

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Michael Van Canneyt via fpc-pascal
On Wed, 19 Jan 2022, Ryan Joseph via fpc-pascal wrote: On Jan 19, 2022, at 4:19 PM, Ryan Joseph wrote: Still not following this. Do you need me to do a pull-rebase from main and then make my pull request? I used git at work everyday but I'm still a newbie in many ways. Reading this no

Re: [fpc-pascal] Case statement for class introspection

2022-01-19 Thread Michael Van Canneyt via fpc-pascal
On Wed, 19 Jan 2022, Ryan Joseph via fpc-pascal wrote: On Jan 19, 2022, at 1:26 PM, Sven Barth wrote: We also take merge requests. If you have a fork anyway, then a merge request is probably easier. Though you need to have your repository set up to use rebasing instead of merging, see h

Re: [fpc-pascal] Case statement for class introspection

2022-01-15 Thread Michael Van Canneyt via fpc-pascal
On Sun, 16 Jan 2022, Ryan Joseph via fpc-pascal wrote: On Jan 16, 2022, at 9:21 AM, Ryan Joseph wrote: There is a possibility for using "as" operator also though oops I mean "is" operator. Not sure if these are technically different from ClassType = ClassType though... They are.

Re: [fpc-pascal] Case statement for class introspection

2022-01-15 Thread Michael Van Canneyt via fpc-pascal
On Sat, 15 Jan 2022, Ryan Joseph via fpc-pascal wrote: On Jan 15, 2022, at 8:30 AM, Michael Van Canneyt via fpc-pascal wrote: I saw a new syntax in Swift which I thought was clever and fits a pattern I've seen before. Basically it's a case statement for class types whic

Re: [fpc-pascal] Case statement for class introspection

2022-01-14 Thread Michael Van Canneyt via fpc-pascal
On Sat, 15 Jan 2022, Ryan Joseph via fpc-pascal wrote: I saw a new syntax in Swift which I thought was clever and fits a pattern I've seen before. Basically it's a case statement for class types which lets you branch depending on which class type the class instance is at run time. I think S

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Michael Van Canneyt via fpc-pascal
On Wed, 12 Jan 2022, James Richters via fpc-pascal wrote: I don’t see what the problem with a shortstring buffer is.. strtoint could not make use of an input string longer than 256 characters anyway, because the output integer could not have more than 19 digits anyway.. so an input string lo

Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Michael Van Canneyt via fpc-pascal
On Tue, 11 Jan 2022, Alexey Tor. via fpc-pascal wrote: Hello. As I see in the commit https://gitlab.com/freepascal.org/fpc/source/-/commit/beecbf1581a986f544fde77aa428e05c21a35f6f StrToInt always uses ShortString buffer: *Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortStrin

Re: [fpc-pascal] FPF 3.04 and Synapse

2022-01-06 Thread Michael Van Canneyt via fpc-pascal
On Thu, 6 Jan 2022, Vern via fpc-pascal wrote: Is Synapse compatible with FPC 3.04  and which link should be used for the Synapse code as there are several ? Synapse is compatible with FPC 3.04. Any download is normally good, but you may wish to download from the official site; http://www

Re: [fpc-pascal] freepascal.org SSL_ERROR_BAD_CERT_DOMAIN

2022-01-05 Thread Michael Van Canneyt via fpc-pascal
On Wed, 5 Jan 2022, Dimitrios Chr. Ioannidis via fpc-pascal wrote: Hi, On 2022-01-05 11:09, Dmitry Boyarintsev via fpc-pascal wrote: On Wed, Jan 5, 2022 at 2:49 AM Dimitrios Chr. Ioannidis via fpc-pascal wrote: the certificate issued for www.freepascal.org [1] and not for freepascal.org [

[fpc-pascal] More Webassembly...

2021-12-30 Thread Michael Van Canneyt via fpc-pascal
Hello, I've just committed to the FPC git repo the wasmtime unit. This unit can be used to load and use the wasmtime library. Using this library you can compile, load and run Webassembly files embedded in your FPC program on all FPC & webassembly supported native platforms. There are 4 demo

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-29 Thread Michael Van Canneyt via fpc-pascal
On Wed, 29 Dec 2021, Graeme Geldenhuys via fpc-pascal wrote: On 2021-12-29 09:54, Michael Van Canneyt via fpc-pascal wrote: They showed clearly that the used protocol (http & xml) is the largest factor. in 2013 I did many tests in a JSON REST framework: the times for streaming were dwa

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-29 Thread Michael Van Canneyt via fpc-pascal
On Wed, 29 Dec 2021, wkitty42--- via fpc-pascal wrote: On 12/29/21 4:54 AM, Michael Van Canneyt via fpc-pascal wrote: Translated to RPC: if you want speed, don't use HTTP or JSON. WST offers a binary protocol and plain TCP channel, it's bound to be much faster. i'm sorry

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-29 Thread Michael Van Canneyt via fpc-pascal
atabase access. Translated to RPC: if you want speed, don't use HTTP or JSON. WST offers a binary protocol and plain TCP channel, it's bound to be much faster. Michael. Thanks, Don On 12/28/2021 2:11 PM, Michael Van Canneyt via fpc-pascal wrote: On Tue, 28 Dec 2021, Graeme Geldenh

Re: [fpc-pascal] Improved FPC JSON-RPC support

2021-12-28 Thread Michael Van Canneyt via fpc-pascal
On Tue, 28 Dec 2021, Graeme Geldenhuys via fpc-pascal wrote: On 2021-12-28 15:25, Michael Van Canneyt via fpc-pascal wrote: Thanks to the magic of RTTI and Invoke(), creating a JSON-RPC server has just become significantly easier ! That's pretty neat - nicely done Michael. We d

[fpc-pascal] Improved FPC JSON-RPC support

2021-12-28 Thread Michael Van Canneyt via fpc-pascal
Hello, Thanks to the magic of RTTI and Invoke(), creating a JSON-RPC server has just become significantly easier ! Given an interface definition: IMyOtherInterface = interface ['{4D52BEE3-F709-44AC-BD31-870CBFF44632}'] Function SayHello : string; function Echo(args : TStringArray) :

Re: [fpc-pascal] FPC and WebAssembly

2021-12-24 Thread Michael Van Canneyt via fpc-pascal
On Fri, 24 Dec 2021, Ryan Joseph via fpc-pascal wrote: On Dec 24, 2021, at 8:13 PM, Michael Van Canneyt via fpc-pascal wrote: Our little contribution to a Merry Christmas for everyone... Nice work. I have a hard time wrapping my head around this. Can you just write plain HTML to

Re: [fpc-pascal] [Pas2js] FPC and WebAssembly

2021-12-24 Thread Michael Van Canneyt via fpc-pascal
And yes, we can do graphics too: https://www.freepascal.org/~michael/pas2js-demos/wasienv/terminal/ That should obviously be: https://www.freepascal.org/~michael/pas2js-demos/wasienv/canvas/ My apologies for the mistake. Michael. ___ fpc-pascal

[fpc-pascal] FPC and WebAssembly

2021-12-24 Thread Michael Van Canneyt via fpc-pascal
Hello, I'm glad to anncounce that FPC now covers working with webassembly in the browser. Because pictures say more than a thousand words, 3 demos: A modest "hello, world" variation: https://www.freepascal.org/~michael/pas2js-demos/wasienv/simple/ A (limited) terminal emulation: https://www

Re: [fpc-pascal] TProcess Running is unreliable on Linux

2021-12-05 Thread Michael Van Canneyt via fpc-pascal
On Sun, 5 Dec 2021, Anthony Walter via fpc-pascal wrote: On Linux using 3.3.1 build of FPC I've found that in many situations the Running property of TProcess is unreliable. Is this a problem with which anyone is familiar? I've searched around and haven't found any discussions related to this

Re: [fpc-pascal] Named optional arguments

2021-11-26 Thread Michael Van Canneyt via fpc-pascal
On Fri, 26 Nov 2021, Ryan Joseph via fpc-pascal wrote: This was discussed before some years ago with no conclusion (https://www.mail-archive.com/fpc-pascal@lists.freepascal.org/msg46280.html) but I'd like to bring it up again. Can we consider extending the variant dispatch call named parame

Re: [fpc-pascal] bounded array types as procedure arguments

2021-10-24 Thread Michael Van Canneyt via fpc-pascal
On Sat, 23 Oct 2021, P Padilcdx via fpc-pascal wrote: Hello, Was trying to declare a procedure with an array argument, e.g. procedure p(a: array[1..9] of int64), and the compiler complained as it seems only accepts open arrays. If I set a type alias for the array, e.g. type t = array[1..9]

Re: [fpc-pascal] Repost: TFieldType declaration change in FPC fixes_3_2 branch

2021-10-17 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Oct 2021, Tony Whyman via fpc-pascal wrote: Yes - but is that really a bug fix that justifies a non-backwards compatible change? That's up for debate of course. Probably it was needed as prerequisite for other bugfixes. Michael. ___ f

Re: [fpc-pascal] Repost: TFieldType declaration change in FPC fixes_3_2 branch

2021-10-17 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Oct 2021, Tony Whyman via fpc-pascal wrote: /Reposted with correct branch identifier/. I thought that a fixes branch was only for bug fixes and not for issuing non-backwards compatible changes. However, TFieldType in db.pas now has 6 extra elements. The result is that IBX no lo

Re: [fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

2021-10-17 Thread Michael Van Canneyt via fpc-pascal
On Sun, 17 Oct 2021, Bo Berglund via fpc-pascal wrote: On Sun, 17 Oct 2021 00:43:51 +0200, Bo Berglund via fpc-pascal wrote: timeout --signal=2 3s strace -f -c -p 488 -o tracelog2.log % time seconds usecs/call callserrors syscall -- --- --- - --

Re: [fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

2021-10-07 Thread Michael Van Canneyt via fpc-pascal
On Thu, 7 Oct 2021, Bo Berglund via fpc-pascal wrote: On Tue, 5 Oct 2021 10:22:44 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: My program in Lazarus *is* a "simple program" and it has no GUI components. I never even looked at the implementation of CheckSynchronize()

Re: [fpc-pascal] My Linux service application consumes 10% CPU when idling - why?

2021-10-05 Thread Michael Van Canneyt via fpc-pascal
On Mon, 4 Oct 2021, Bo Berglund via fpc-pascal wrote: On Mon, 04 Oct 2021 12:46:32 -0400, Dennis Lee Bieber via fpc-pascal wrote: COMMENT: here you ask about a non-GU /service/ application, but in your prior post you gave a code snippet. It may just be a documentation flaw, but...

Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Michael Van Canneyt via fpc-pascal
On Tue, 28 Sep 2021, Anthony Walter via fpc-pascal wrote: For the benefit of others, there are a few problems with the FPC example to note. 1) The callback CURLOPT_WRITEFUNCTION should return the number of bytes handled. It does that ? Result:=TStream(Data).Write(Ptr^,Size*nmemb); Write

Re: [fpc-pascal] How To: Use lib curl example

2021-09-28 Thread Michael Van Canneyt via fpc-pascal
On Mon, 27 Sep 2021, Anthony Walter via fpc-pascal wrote: I was having some problems using vanilla sockets and OpenSSL to read a few specific web pages using HTTPS. Normally I don't have any problems using HTTPS, but with a few sites my code was not working. I ending up finding the RTL unit Li

Re: [fpc-pascal] FreePascal and MySQL 8.0

2021-09-19 Thread Michael Van Canneyt via fpc-pascal
On Sun, 19 Sep 2021, Florian Klämpfl via fpc-pascal wrote: Am 19.09.2021 um 10:16 schrieb Michael Van Canneyt via fpc-pascal : On Sat, 18 Sep 2021, Florian Klämpfl via fpc-pascal wrote: Am 18.09.21 um 17:34 schrieb Michael Van Canneyt via fpc-pascal: On Sat, 18 Sep 2021, Terry A

Re: [fpc-pascal] FreePascal and MySQL 8.0

2021-09-19 Thread Michael Van Canneyt via fpc-pascal
On Sat, 18 Sep 2021, Florian Klämpfl via fpc-pascal wrote: Am 18.09.21 um 17:34 schrieb Michael Van Canneyt via fpc-pascal: On Sat, 18 Sep 2021, Terry A. Haimann via fpc-pascal wrote: I just upgraded to a new laptop and see that MariaDB is using MySQL 8.0 . I also see there is no

Re: [fpc-pascal] FreePascal and MySQL 8.0

2021-09-18 Thread Michael Van Canneyt via fpc-pascal
On Sat, 18 Sep 2021, Terry A. Haimann via fpc-pascal wrote: I just upgraded to a new laptop and see that MariaDB is using MySQL 8.0 . I also see there is no connector in my Free Pascal install for MySQL 8.0. I do see that there is an open ticket to create a connector. Is there an Alpha or Be

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

2021-09-16 Thread Michael Van Canneyt via fpc-pascal
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: TStringSplitOptions): TStringArray; overload; (fpc 3.2.2) Why does

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, James Richters wrote: Well, that sure is a lot simpler than parsing the IPConfig output! Is there a way to capture the MAC address this way as well? I don't know, I never needed that. uses {$IFDEF MSWINDOWS}Windows, WinSock,{$ENDIF} Should have a ; at the end instead

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, Luca Olivetti via fpc-pascal wrote: El 10/9/21 a les 10:21, Michael Van Canneyt via fpc-pascal ha escrit: https://gitlab.com/dashboard/issues?scope=all&state=all&author_username=olivluca This one works though https://gitlab.com/dashboard/issues?scope=a

Re: [fpc-pascal] How to list IP and MAC of network adapters on Windows?

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, Sven Barth via fpc-pascal wrote: Bo Berglund via fpc-pascal schrieb am Fr., 10. Sep. 2021, 09:41: Is there a way to enumerate the active adapters on a Windows computer with their IPv4 and MAC addresses? There is an API for that, but I don't remember that right now.

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, Luca Olivetti via fpc-pascal wrote: El 10/9/21 a les 9:39, Luca Olivetti via fpc-pascal ha escrit: El 10/9/21 a les 8:12, Michael Van Canneyt via fpc-pascal ha escrit: Then it means the FPC issues  should appear in your gitlab todo list. I don't know if is

Re: [fpc-pascal] Inactive account on GitLab

2021-09-09 Thread Michael Van Canneyt via fpc-pascal
On Fri, 10 Sep 2021, denisgolovan wrote: FPC's git and issue trackers are hosted on Gitlab itself, we have no authority to do user management. Ok. I managed to sign up and login. Does it mean my old issues cannot be linked to my GitLab account? If you did not enter your gitlab account in

Re: [fpc-pascal] Inactive account on GitLab

2021-09-09 Thread Michael Van Canneyt via fpc-pascal
On Thu, 9 Sep 2021, denisgolovan via fpc-pascal wrote: Hi all Could anybody look at GitLab MageSlayer account? I can neither login nor change my password. Maybe my mail has not been transferred? FPC's git and issue trackers are hosted on Gitlab itself, we have no authority to do user mana

<    1   2   3   4   5   >