Re: [fpc-pascal] Set limitations

2025-01-11 Thread Martin Frb via fpc-pascal
On 11/01/2025 14:57, Hairy Pixels via fpc-pascal wrote: On Jan 11, 2025 at 8:17:33 PM, Hairy Pixels wrote: I was curious, is there any practical limit on the size of a set (32 bits and 256 values) and why they couldn’t be 64 bit or any other arbitrary size? The floor seems to be 4 bytes too bu

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Martin Frb via fpc-pascal
On 01/11/2024 16:16, Martin Frb via fpc-pascal wrote: On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote: When I add -Xg, the compiler writes the debug info into a separate .dbg file and adds a .gnu_debuglink section so the debugger can find the info. So far so good (and simpler than

Re: [fpc-pascal] Separate debug info for release builds

2024-11-01 Thread Martin Frb via fpc-pascal
On 01/11/2024 15:59, Henry Vermaak via fpc-pascal wrote: When I add -Xg, the compiler writes the debug info into a separate .dbg file and adds a .gnu_debuglink section so the debugger can find the info. So far so good (and simpler than having the use objcopy). The size of the binary is much lar

Re: [fpc-pascal] question on docs

2024-10-20 Thread Martin Frb via fpc-pascal
The compare function is declared right inside the class   { TFPGList }   generic TFPGList = class(TFPSList)   private     type   TCompareFunc = function(const Item1, Item2: T): Integer; "T" is from the generic, so if you specialized with string, then T is string. It is a function, not a

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 15:34, Hairy Pixels via fpc-pascal wrote: On Oct 19, 2024 at 8:06:56 PM, Rainer Stratmann via fpc-pascal wrote: Sorry, but if you start then you start with a simple program and then you have to gain experience over time. That is the same case everywhere. There is a german saywor

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 15:17, Hairy Pixels via fpc-pascal wrote: On Oct 19, 2024 at 8:06:44 PM, Martin Frb via fpc-pascal wrote: NOTE: the below is NOT about ARC. It is about the implication that ARC == Safety (in the environment that we have) Not following "in the environment that we have”. I’m

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 14:57, Hairy Pixels via fpc-pascal wrote: On Oct 19, 2024 at 7:53:14 PM, Rainer Stratmann via fpc-pascal wrote: I feel very safe with freepascal. I don't know what you are talking about. It depends on the programmer who is in front of the computer. We’re talking about new users

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 14:20, Hairy Pixels via fpc-pascal wrote: The bigger problem though is now everyone is forced to use ARC on new projects and the old RTL is frozen in time. This is very bad of course and deal breaker. And actually: ARC, are we talking the simple version => just a refcount, a

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 14:20, Hairy Pixels via fpc-pascal wrote: The bigger problem though is now everyone is forced to use ARC on new projects and the old RTL is frozen in time. This is very bad of course and deal breaker. Who is forcing *everyone* ? To the day, that person has not knocked on my doo

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Martin Frb via fpc-pascal
On 19/10/2024 10:35, Michael Van Canneyt via fpc-pascal wrote: On Fri, 18 Oct 2024, Hairy Pixels via fpc-pascal wrote: You just only adopt it when you want it or in new programs entirely. Remember we’re talking about new users with no programs wanting to start fresh. You are not taking the r

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-18 Thread Martin Frb via fpc-pascal
On 18/10/2024 10:41, Karoly Balogh via fpc-pascal wrote: For once, I'd be really glad if a bunch of the containers would be Thread-Safe by default, like TList and things, and they aren't, because they're based on almost 3 decade old Delphi concepts, when multithreading wasn't as big of a deal as

Re: [fpc-pascal] What to do to get new users

2024-10-17 Thread Martin Frb via fpc-pascal
On 17/10/2024 03:24, Ralf Quint via fpc-pascal wrote: Sorry, but do you really suggest that Lazarus should intentionally adjust itself to the shortcomings of other IDEs? Being able to move windows around over multiple (2 or 3) monitors is the most effective way to work., l Nope. (And I do pre

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Martin Frb via fpc-pascal
On 16/10/2024 18:06, Rainer Stratmann via fpc-pascal wrote: Am Mittwoch, 16. Oktober 2024, 15:54:20 CEST schrieb Martin Frb via fpc- pascal: Define "Compiler". You use one and the same fpc.exe. But you need a different ppc.exe. All those ppc live in the same folder. And th

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Martin Frb via fpc-pascal
On 16/10/2024 18:06, Rainer Stratmann via fpc-pascal wrote: Am Mittwoch, 16. Oktober 2024, 15:54:20 CEST schrieb Martin Frb via fpc- pascal: Define "Compiler". You use one and the same fpc.exe. But you need a different ppc.exe. All those ppc live in the same folder. And th

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Martin Frb via fpc-pascal
On 16/10/2024 15:29, Rainer Stratmann via fpc-pascal wrote: Am Mittwoch, 16. Oktober 2024, 11:20:35 CEST schrieb Martin Frb via fpc- pascal: If it is cross compiling (using same compiler version), and if the compiler is installed (as cross compiler): Project Options > Compiler opts > Conf

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-16 Thread Martin Frb via fpc-pascal
On 16/10/2024 13:49, Hairy Pixels via fpc-pascal wrote: I’ve watched the community dwindle over the years and people move on and new programmers adopt new languages. It’s clearly going in the wrong direction as noted by the original post. Am I wrong? You may be wrong... I don't have the num

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Martin Frb via fpc-pascal
I am cross posting this to the Lazarus list, since some of this relates to Lazarus. On 16/10/2024 01:07, Rainer Stratmann via fpc-pascal wrote: - Lazarus looks very complicated with its many windows. And it is also relatively complicated to understand and use. There are too many options that ar

Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Martin Frb via fpc-pascal
On 02/05/2024 08:32, Adriaan van Os via fpc-pascal wrote: Martin Frb via fpc-pascal wrote: Silly question, but did you assign the value to the variable? myClass := TWindow; That's what I did. TWindow(myClass).CreateNewWindow; And this is what crashes. I can report this, if the type

Re: [fpc-pascal] Type-casting a class variable

2024-05-01 Thread Martin Frb via fpc-pascal
On 01/05/2024 16:28, Adriaan van Os via fpc-pascal wrote: Suppose I have a var myClass: TClass and (for example) a class function TWindow.CreateNewWindow( ) Now I want to call CreateNewWindow for var myClass. Of course, depending on the class, CreateNewWindow will behave differen

Re: [fpc-pascal] Strings greater than 255 characters

2023-12-19 Thread Martin Frb via fpc-pascal
On 19/12/2023 12:36, James Richters via fpc-pascal wrote: I did notice that I cannot have a file of Ansistrings… Myfile : File of Ansistring; Causes a compiler error: Error: Typed files cannot contain reference-counted types. A "file of" must have a fixed size type. "file of word", reads

Re: [fpc-pascal] method-definition

2023-12-15 Thread Martin Frb via fpc-pascal
On 15/12/2023 14:56, Adriaan van Os via fpc-pascal wrote: I am puzzled by the syntax rule in Chapter 6. Classes of the FreePascal Language Reference (version 3.2.0) Section 6.1 Class definitions has method-definition = [ "CLASS" ] ( function-header | procedure-header | constructor-header

Re: [fpc-pascal] operator := in mode delphi?

2023-10-25 Thread Martin Frb via fpc-pascal
artin Frb via fpc-pascal schrieb am Di., 24. Okt. 2023, 23:30: Is there a modeswitch to enable it? Because currently I am getting an error in mode delphi. In mode Delphi it's called "Implicit" as Delphi does not support symbolic operator overlo

[fpc-pascal] operator := in mode delphi?

2023-10-24 Thread Martin Frb via fpc-pascal
Is there a modeswitch to enable it? Because currently I am getting an error in mode delphi. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] All methods vitrual ?

2023-10-11 Thread Martin Frb via fpc-pascal
On 11/10/2023 16:46, Adriaan van Os via fpc-pascal wrote: I don't see any use in allowing or disallowing something. And with the current design, it is, as I said, impossible, without macros, to compile the same code with {$M+} and {$M-}. Use $IfOpt instead of macros? {$IfOpt M+} published {$E

Re: [fpc-pascal] Parse unicode scalar

2023-07-02 Thread Martin Frb via fpc-pascal
On 02/07/2023 19:20, Nikolay Nikolov via fpc-pascal wrote: On 7/2/23 16:30, Hairy Pixels via fpc-pascal wrote: I'm interested in parsing unicode scalars (I think they're called) to byte sized values but I'm not sure where to start. First thing I did was choose the unicode scalar U+1F496 (💖).

Re: [fpc-pascal] 3123 inherited not supported inside inline

2023-06-24 Thread Martin Frb via fpc-pascal
On 24/06/2023 17:21, Hairy Pixels via fpc-pascal wrote: On Jun 24, 2023, at 10:11 PM, Hairy Pixels wrote: Doesn't this mean the compiler can dictate the binary size by inlining everything even if the programmer doesn't want that? and another thing, I have frequent problems with a crash whic

Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Martin Frb via fpc-pascal
On 04/06/2023 17:49, Martin via fpc-pascal wrote: On 04/06/2023 15:04, Juha Manninen via fpc-pascal wrote: Why the following code fails to compile? MyObj.RecInstance.ii := 123; Technically you can modify the members of the temp record (just to have the work thrown away afterwards). So I guess

Re: [fpc-pascal] Error: Argument cannot be assigned to

2023-06-04 Thread Martin Frb via fpc-pascal
On 04/06/2023 15:04, Juha Manninen via fpc-pascal wrote: Why the following code fails to compile?   TMyRec = record ... property     RecInstance: TMyRec read fRecInstance;// write fRecInstance; ... MyObj.RecInstance.ii := 123; Access through property seems to be the problem. Accessing fRecI

Re: [fpc-pascal] Forking the GitLab FPC Source repository

2023-05-01 Thread Martin Frb via fpc-pascal
On 01/05/2023 20:02, Norman Dunbar via fpc-pascal wrote: On 1 May 2023 17:27:52 BST, Christo Crause via fpc-pascal wrote: > FWIW, there are currently 68 forks of > the FPC source repository on GitLab. ... I noticed that when I tried to fork it. Unfortunately I am not able to fork those now e

Re: [fpc-pascal] pointer to char vs pchar

2023-03-24 Thread Martin Frb via fpc-pascal
On 24/03/2023 15:04, Benito van der Zander via fpc-pascal wrote: why is a pointer to a char not a pchar (for type helpers)? My guess: For the same reason that "p2" fails in the below. Distinct type. May be assignment compatible, but a type of it's own. Imagine you had a different helper, with

Re: [fpc-pascal] Downloaded cross-compiler from Sourceforge - wiki incorrect?

2023-03-24 Thread Martin Frb via fpc-pascal
On 24/03/2023 07:38, Bo Berglund via fpc-pascal wrote: On Thu, 23 Mar 2023 09:47:36 +0100, Martin Frb via fpc-pascal wrote: You need to change the CPU to i386 too OK, I thought that the current processor could be used since it can run both types of programs... Well no, and probably for

Re: [fpc-pascal] Downloaded cross-compiler from Sourceforge - wiki incorrect?

2023-03-23 Thread Martin Frb via fpc-pascal
On 23/03/2023 09:25, Bo Berglund via fpc-pascal wrote: Then opened Lazarus 2.2.4 with my project and changed project options as follows: Compiler_Options/Config_and_Target/Target OS(-T): Win32 Everything else left as-is. You need to change the CPU to i386 too ___

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

2022-08-03 Thread Martin Frb via fpc-pascal
On 03/08/2022 12:41, wkitty42--- via fpc-pascal wrote: On 8/2/22 5:12 AM, Michael Van Canneyt via fpc-pascal wrote: The variant part of a record must always come last. FWIW: is this documented somewhere easily found? google free pascal language reference https://www.freepascal.org/docs-html

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

2022-05-29 Thread Martin Frb via fpc-pascal
On 29/05/2022 07:21, Michael Van Canneyt via fpc-pascal wrote: 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

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

2022-05-15 Thread Martin Frb via fpc-pascal
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 := low(TMySet) to high(TMySet) do     ; __

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

2022-04-25 Thread Martin Frb via fpc-pascal
On 25/04/22 05:15, Hairy Pixels via fpc-pascal wrote: generic function Add(left, right: T): T; And the programmer intends to call it like: Add(1,1); Why should the programmer need to tell the compiler it’s dealing with Integer when it’s so obvious from the types being used? Actuall

Re: [fpc-pascal] Possible fpdebug issue

2022-04-24 Thread Martin Frb via fpc-pascal
Lazarus 2.2 or 2.3 ? In 2.3 some work has been started to debug into dll... Is there a way to reproduce this? Also try: lazarus.exe  --debug-log=c:\logfile.txt --debug-enable=DBG_EVENTS,DBG_VERBOSE,DBG_WARNINGS,DBG_ERRORS,DBG_VERBOSE_BRKPOINT,DBG_STATE,DBG_COMMAND_ECHO,DBG_DATA_MONITORS,DBG_LOCA

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

2022-04-22 Thread Martin Frb via fpc-pascal
Possible one more / Though more of an optimization. If the code has multiple     Add(Int64(0), Int64(0)); then they will all use the same procedure (just break in the debugger and check the CRC). But if  one specialization is explicit and the other implicit then 2 identical (as far as I can t

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

2022-04-22 Thread Martin Frb via fpc-pascal
On 22/04/2022 23:12, Sven Barth via fpc-pascal wrote: Am 22.04.2022 um 20:51 schrieb Martin Frb via fpc-pascal: So why does it generate "Add$1" if it does not use it? (Or rather why does it warn, if this is some internal details?) Add$1 is the symbol of the generic itself,

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

2022-04-22 Thread Martin Frb via fpc-pascal
On 20/04/2022 19:15, Sven Barth via fpc-pascal wrote: This feature allows you to use generic routines (functions, procedures, methods) without explicitely specializing them (“<…>” in Delphi modes and “specialize …<…>” in non-Delphi modes) as long as the compiler can determine the correct parame

Re: [fpc-pascal] RTLEventWaitFor

2022-04-05 Thread Martin Frb via fpc-pascal
On 05/04/2022 01:03, Mattias Gaertner via fpc-pascal wrote: 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. Has anyone an idea if this is normal on Windows and if there is an alternativ

Re: [fpc-pascal] Inactive account on GitLab

2021-09-10 Thread Martin Frb via fpc-pascal
On 10/09/2021 10:42, Luca Olivetti via fpc-pascal wrote: Not a biggie now that I know how to find my bugs, though I'd prefer to find them with the proper filter (the first one with author_username) and not with a full text search. Still a full search, but more precise: https://forum.lazarus.

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

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

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 15:30, Martin Frb via fpc-pascal wrote: depth=1 gitlab also offers you a tar.gz (or zip, or...) https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.tar.gz https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/lazarus_2_2_0_RC1/lazarus

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 15:11, Bo Berglund via fpc-pascal wrote: On Wed, 11 Aug 2021 23:13:28 +0200, Martin Frb via fpc-pascal wrote: Well I don't know your script, and I am not sure how exactly you do that in svn It is not done in SVN, instead I visit the (now removed) page

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 15:04, Michael Van Canneyt via fpc-pascal wrote: If you do an update of an existing directory, instead of git clone http://theurl/ thesourcedirectory you must do cd thesourcedirectory git pull cd .. This will reduce the download size considerably. If he stays on the same bran

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 11/08/2021 22:12, Bo Berglund via fpc-pascal wrote: Please advice how to: 1) Find which is the latest release tag of fpc and lazarus Well I don't know your script, and I am not sure how exactly you do that in svn Also I do not know, if this is for a once up setup (so you only wont to

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 06:26, Michael Van Canneyt via fpc-pascal wrote: Well, sorry to say, but I don't understand this. What's so hard about it ? It's like switching car brands from a VW to an Audi or so. Some buttons are in different places, your key will maybe look different, but that's it. It's a c

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 10:53, Christo Crause via fpc-pascal wrote: On Thu, Aug 12, 2021 at 7:34 AM LacaK via fpc-pascal > wrote: I have related question: in SVN was possible to checkout specific sub-directory (for example if I am interested in fcl-db pa

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 02:02, Dennis Lee Bieber via fpc-pascal wrote: And... the local repository will add files for each committed change... https://www.dulwich.io/docs/tutorial/file-format.html """ If you change a single line, another blob will be generated by Git each time you successfully ru

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 06:26, Michael Van Canneyt via fpc-pascal wrote: Well, sorry to say, but I don't understand this. What's so hard about it ? It's like switching car brands from a VW to an Audi or so. Some buttons are in different places, your key will maybe look different, but that's it. It's a c

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 11/08/2021 22:12, Bo Berglund via fpc-pascal wrote: Please advice how to: 1) Find which is the latest release tag of fpc and lazarus Well I don't know your script, and I am not sure how exactly you do that in svn Also I do not know, if this is for a once up setup (so you only wont to

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

2021-08-12 Thread Martin Frb via fpc-pascal
On 12/08/2021 06:55, Dmitry Boyarintsev via fpc-pascal wrote: On Thu, Aug 12, 2021 at 12:27 AM Michael Van Canneyt via fpc-pascal > wrote: It's like switching car brands from a VW to an Audi or so. Some buttons are in different places, your key wi

Re: [fpc-pascal] FPC & Lazarus moving to gitlab

2021-07-04 Thread Martin Frb via fpc-pascal
On 04/07/2021 21:25, Bo Berglund via fpc-pascal wrote: Does this mean that the sources will disappear from SVN? From the current svn => yes. afaik I am using scripts to install FPC and Lazarus on new systems and these use svn co commands towards: https://svn.freepascal.org/svn/fpc/tags/ https

Re: [fpc-pascal] Option type

2021-06-02 Thread Martin Frb via fpc-pascal
On 01/06/2021 22:40, Sven Barth via fpc-pascal wrote: Am 01.06.2021 um 20:20 schrieb denisgolovan via fpc-pascal: I am trying to implement Option type in FPC. type    generic TOption = record case IsSome:boolean of true: ( some: T ); false: ();    end; Well as already discover

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Martin Frb via fpc-pascal
On 19/05/2021 00:29, Bo Berglund via fpc-pascal wrote: While not (bSTerm or bSInt or bsHup) do begin //Here is where the server runs as defined elsewhere //Eternal loop to wait for system messages Sleep(1); //To not hog the CPU CheckSynchronize;

Re: [fpc-pascal] [fpc-devel] Nested function closures

2021-04-28 Thread Martin Frb via fpc-pascal
On 28/04/2021 18:43, Graeme Geldenhuys via fpc-pascal wrote: Hello Sven, On 28/04/2021 6:32 am, Sven Barth via fpc-pascal wrote: Second: the syntax is required for Delphi compatibility anyway Couldn't such verbose syntax be limited to {$mode delphi} behaviour, and then leave {$mode objfpc} fre

Re: [fpc-pascal] lazarus ide space/dot display

2021-04-06 Thread Martin Frb via fpc-pascal
On 06/04/2021 18:26, jean-françois Jouvet via fpc-pascal wrote: does anyone knows how avoid display dot point for space between 2 words? Thanks in advance Menu: Tools > Options Page: Editor > General > Miscellaneous: Turn off "Show special characters" That will turn off tabs and spaces anywhe

Re: [fpc-pascal] Pull request for fphttpclient.pp in git mirror repo

2021-03-16 Thread Martin Frb via fpc-pascal
On 16/03/2021 22:21, Graeme Geldenhuys via fpc-pascal wrote: https://github.com/graemeg/freepascal/pull/18 Review instructions: For none git users, githup offers patch/diff https://github.com/graemeg/freepascal/compare/master...billyeatcookies:patch-1.diff https://github.com/graemeg/free

Re: [fpc-pascal] Unicode chars losing information

2021-03-08 Thread Martin Frb via fpc-pascal
On 08/03/2021 23:26, Tomas Hajny via fpc-pascal wrote: On 2021-03-08 21:36, Martin Frb via fpc-pascal wrote: I can think of 2 groups already. 1) Conversion due to explicit declared different encoding.    AnAnsiString := SomeWideString;   AnAsciiString := AnUtf8String; // declared as "

Re: [fpc-pascal] Unicode chars losing information

2021-03-08 Thread Martin Frb via fpc-pascal
On 08/03/2021 20:49, Jonas Maebe via fpc-pascal wrote: On 08/03/2021 19:16, Ryan Joseph via fpc-pascal wrote: I agree it would be nice to have some warning that indexing the unicodeString wouldn't work as expected. Then the compiler would have to give a warning for any indexing of unicodestrin

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Martin Frb via fpc-pascal
On 18/02/2021 23:47, Ryan Joseph via fpc-pascal wrote: On Feb 18, 2021, at 12:33 PM, Martin Frb via fpc-pascal wrote: TMyFoo = class(specialize TTrait) procedure Foo; end; Of course that can get out of hand, if you want to include many traits. I'm not really understand th

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Martin Frb via fpc-pascal
On 18/02/2021 22:42, Sven Barth wrote: You need to constrain T as a TObject, then it works. Ah that works. With 2 restrictions TBase can be any class, since a trait can be applied to any class. So the only known common base is TObject. (restriction 1) But "TBase: TObject" means that the trai

Re: [fpc-pascal] Traits Proposal

2021-02-18 Thread Martin Frb via fpc-pascal
On 18/02/2021 18:46, Ryan Joseph via fpc-pascal wrote: On Feb 18, 2021, at 10:40 AM, Benito van der Zander via fpc-pascal wrote: Traits are like reverse type helpers. With the type helper you first declare the class and then the extending helper. Indeed, but with the crucial distinction th

Re: [fpc-pascal] Traits Proposal

2021-02-14 Thread Martin Frb via fpc-pascal
On 14/02/2021 18:20, Sven Barth via fpc-pascal wrote:    TTest = class(TObject, ITest)    private fTest: TTestImpl;    public property Test: TTestImpl read fTest implements ITest; default;    end; Well there is a difference there. Interfaces are essentially inheritance. One can ac

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-13 Thread Martin Frb via fpc-pascal
On 13/02/2021 16:52, Ched via fpc-pascal wrote: Hello, For one software I compile with fpc, Avast always complained. But only when compiled for debugging. That exe was sent to the false positive departement, and it toke about _one mounth_ to have a corrected version of the AV. Afterwhat, he n

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-13 Thread Martin Frb via fpc-pascal
On 13/02/2021 03:55, Travis Siegel via fpc-pascal wrote: that if you have any timing routines in your code, it tends to get flagged by virus scanners.  No clue why, but I've run afoul of that issue more than once. I read somewhere that some viruses have a build in wait, to evade sandbox detec

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-12 Thread Martin Frb via fpc-pascal
On 12/02/2021 22:48, James Richters via fpc-pascal wrote: I have no idea how to register a legitimate program as not having a virus. I've had this issue before but managed to track down the section of code that caused it... after a completely exhaustive search. Anti virus providers normal

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 04:13, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 7:47 PM, Martin Frb via fpc-pascal wrote: In that case IIRC, it was said traits are not allowed constructors. Why? Traits are meant to be a way to import fields/methods and is based off of "object" (so i

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 04:20, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 7:47 PM, Martin Frb via fpc-pascal wrote: I understand it is for conflict resolution only. But see my example => as soon as you need to repeat a trait with just a change in name, you always need conflict resolut

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 03:07, Ryan Joseph via fpc-pascal wrote: We get the shared namespace So basically, we get the compiler to automatically create forwarder methods for us (or at least that behaviour). And that is all there is. right? In that case IIRC, it was said traits are not allowed construct

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 21:17, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 12:40 PM, Martin Frb via fpc-pascal wrote: type TSomeTrait = trait public procedure DoTraitFoo; end; TSomeClass = class(TObject) private trait: TSomeTrait; // whatever syntax is used so that

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 20:17, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 11:09 AM, Ryan Joseph wrote: type TSomeTrait = trait public parent: TObject; procedure DoThis; end; procedure TSomeTrait .DoThis; begin // ??? here is our issue. Is this good enough to call the TBaseC

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 16:59, Ryan Joseph via fpc-pascal wrote: • PHP (trait): https://www.php.net/manual/en/language.oop5.traits.php The example exposes another aspect: |trait SayWorld { public function sayHello() { parent::sayHello();| |In this case the trait has access to the object/class in

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-31 Thread Martin Frb via fpc-pascal
On 31/12/2020 18:11, James Richters via fpc-pascal wrote: Thanks for the info on SynEdit. Where can I find the synedit source related to the clipboard? I think the link you indtended ater 'See the code at.' Didn't come though, can you pleaese send it again? Sorry, I assumed SynEdit would be

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
I missed you have FN:=StrAlloc (255); in that case see Alexanders response. On 31/12/2020 02:00, Martin Frb via fpc-pascal wrote: FN must point to an existing buffer (allocated mem) that receives the result. FN : Array [0..255]of Byte; GotLen := GetClipboardFormatName(Format_Id, LPTSTR(@FN

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
On 31/12/2020 01:09, James Richters via fpc-pascal wrote: Var FN : LPTSTR; Begin FN:=''; Writeln(Format_ID); GetClipboardFormatName(Format_Id,FN,250); Check the msdn help. https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuse

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
On 31/12/2020 01:09, James Richters via fpc-pascal wrote: I'm trying to write a programs to get data from the windows clipboard that was put into it with Notepad++ using vertical editing. Just for Info, SynEdit (trunk) can handle notepad++ column selection See the code at. There are 2 common f

[fpc-pascal] Off topic Re: TurboVision is reborn as FOSS (again)

2020-12-22 Thread Martin Frb via fpc-pascal
On 21/12/2020 10:26, Markus Greim via fpc-pascal wrote: Hello Nikolay, I am a German - so may be we are both "lost in translation" Sent from Front English and German tenses are very much alike. Except for English having the progressive forms, which do not exist in German (...ing form) past p

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 17:44, Martin Frb via fpc-pascal wrote: type   TMyData = class       FData: array of byte;    end;   TMyThreadedQueue = specialize TLazThreadedQueue; Of course you can do   TMyData = array of byte;  // or record end if you want   TMyThreadedQueue = specialize

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 16:36, Bo Berglund via fpc-pascal wrote: A "simplest case" usage example would be nice to have. True. Once you got enough info from this thread, please write one. I still when looking at the sources have no clue as to how it would be used... It seems to me like at the very least

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 14:54, Bo Berglund via fpc-pascal wrote: Now to my question: Is there some *example* around for using TLazThreadedQueue as a circular buffer? In the examples dir are only examples for LazUnicode and LookUpStringList... And when reading the sources I cannot really say I understand wh

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 10:09, Bo Berglund via fpc-pascal wrote: I would like to create a buffer into which a thread can push incoming data and the main thread can extract it for processing. Data are coming from the serial port in a worker thread and should be consumed by the main thread. The data is a byt