Re: [fpc-pascal] Copying a Pchar to an array of bytes

2020-05-19 Thread Luca Olivetti
El 19/5/20 a les 19:05, Giuliano Colla ha escrit: Move(Hello,buffer,len); <--- Garbage in buffer - doesn't work Move(Hello^,buffer,len) Bye -- Luca ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Copying a Pchar to an array of bytes

2020-05-19 Thread Giuliano Colla
Thank you both guys. Il 19/05/2020 19:28, Alexander Grotewohl ha scritto: do move(Hello^, ... -- Do not do to others as you would have them do to you.They might have different tastes. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Michael Van Canneyt
On Tue, 19 May 2020, Giuliano Colla wrote: Il 19/05/2020 18:57, Michael Van Canneyt ha scritto: They are not missing. How do you think fpsock and lnet implement non-blocking ? It's simply called  O_NONBLOCK. I'm using fpc 3.0.4. With just Sockets in the uses clause both SOCK_NONBLOCK

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Norbert Saint Georges
Giuliano Colla a écrit : Il 19/05/2020 18:57, Michael Van Canneyt ha scritto: They are not missing. How do you think fpsock and lnet implement non-blocking ? It's simply called  O_NONBLOCK. I'm using fpc 3.0.4. With just Sockets in the uses clause both SOCK_NONBLOCK and O_NONBLOCK give an

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Giuliano Colla
Il 19/05/2020 18:57, Michael Van Canneyt ha scritto: They are not missing. How do you think fpsock and lnet implement non-blocking ? It's simply called  O_NONBLOCK. I'm using fpc 3.0.4. With just Sockets in the uses clause both SOCK_NONBLOCK and O_NONBLOCK give an Identifier not found

Re: [fpc-pascal] Copying a Pchar to an array of bytes

2020-05-19 Thread Alexander Grotewohl
I believe pchar has special treatment where pchar[i] is the same as pchar^[i] do move(Hello^, ... -- Alexander Grotewohl https://dcclost.com From: fpc-pascal on behalf of Giuliano Colla Sent: Tuesday, May 19, 2020 1:05:54 PM To: FPC-Pascal users discussions

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Alexander Grotewohl
It was added for Linux 3.9 in 2013.. maybe the code predates that? -- Alexander Grotewohl https://dcclost.com From: fpc-pascal on behalf of Michael Van Canneyt Sent: Tuesday, May 19, 2020 12:57:37 PM To: FPC-Pascal users discussions Cc: bo.bergl...@gmail.com

[fpc-pascal] Copying a Pchar to an array of bytes

2020-05-19 Thread Giuliano Colla
I'm not too familiar with Pchar, and apparently I'm missing something. I have a Pchar string which I must copy into an array of bytes. Could someone explain me while a move doesn't work while an assignment byte by byte does? Here's a snippet of the code: buffer: array [0..1023] of byte;

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Michael Van Canneyt
On Tue, 19 May 2020, Giuliano Colla wrote: I'm struggling with a similar problem. It would appear that the easiest way would be just take advantage of the Sockets unit. You only must define some more constants, such as SO_REUSEPORT and SOCK_NONBLOCK which are missing in fpc. They are not

Re: [fpc-pascal] How to implement a simple tcp/ip connection?

2020-05-19 Thread Giuliano Colla
I'm struggling with a similar problem. It would appear that the easiest way would be just take advantage of the Sockets unit. You only must define some more constants, such as SO_REUSEPORT and SOCK_NONBLOCK which are missing in fpc. I just made some preliminary tests, and it looks like it's

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 15:55, Joost van der Sluis wrote: On 5/19/20 12:59 PM, Martin Frb wrote: Where is that documented? Assuming this is part of the API? E.g. what goes into Flags/AdditionalInfo? You misunderstood me. The class above is my own design. The variable-definition of DAB is even simpler.

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Joost van der Sluis
On 5/19/20 12:59 PM, Martin Frb wrote: On 19/05/2020 10:42, Joost van der Sluis wrote: It is basically this class: (see https://gitlab.freepascal.org/Joost/fpdserver/blob/master/fpdbgvariables.pas)   TDbgVariable = class   private     FName: string;     FValue: string;     FType: string;    

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 12:59, Martin Frb wrote: Where is that documented? Assuming this is part of the API? The closest I could find: https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable I would much prefer if "Flags: TStringArray" could be a "set of (...)" And then somehow

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 10:42, Joost van der Sluis wrote: Yes, you write about it earlier. Now it's time to discuss things. Looking at the DAB-protocol I came to some new insights. Microsoft managed to create a simple interface which makes it possible for all kinds of debuggers to work with the same

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Joost van der Sluis
On 5/19/20 12:22 AM, Martin Frb wrote: On 18/05/2020 23:43, Joost van der Sluis wrote: All the basics should work, if someone could test it a bit that would be nice. Threading-support is still very lacking, and how variables are presented is not really nice. I'll be working on that. While