Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Di., 3. Jan. 2023, 08:04: > > > > On Jan 3, 2023, at 1:36 PM, Sven Barth > wrote: > > > > Objects are not classes, they don't know the Object Pascal style syntax > for creating them, instead you need to use the syntax for objects from TP > times: > > But why do you need

Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Hairy Pixels via fpc-pascal
> On Jan 3, 2023, at 3:12 PM, Sven Barth wrote: > > But then you don't use the type name either. You simply do "o.Create(...)". > O I get it now. I didn’t realize you couldn’t create on the type. That breaks my entire design then. It would be great to have a modern object that behaved

[fpc-pascal] For Loop with QWord

2023-01-03 Thread James Richters via fpc-pascal
I'm wondering why I can't have the following: Var I: QWord; Begin For I := 1 To N Do . It generates an error: Error: Ordinal expression expected If I change it to LongInt, then it works, but the question is, why can't I use a Qword here if I know I will never need I to be a negative

Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Sven Barth via fpc-pascal
Hairy Pixels schrieb am Di., 3. Jan. 2023, 14:07: > > > > On Jan 3, 2023, at 3:12 PM, Sven Barth > wrote: > > > > But then you don't use the type name either. You simply do > "o.Create(...)". > > > > O I get it now. I didn’t realize you couldn’t create on the type. That > breaks my entire

Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Marc Weustink via fpc-pascal
On 3-1-2023 14:07, Hairy Pixels via fpc-pascal wrote: On Jan 3, 2023, at 3:12 PM, Sven Barth wrote: But then you don't use the type name either. You simply do "o.Create(...)". O I get it now. I didn’t realize you couldn’t create on the type. That breaks my entire design then. It

Re: [fpc-pascal] For Loop with QWord

2023-01-03 Thread Bart via fpc-pascal
On Tue, Jan 3, 2023 at 3:49 PM James Richters via fpc-pascal wrote: > Var > > I: QWord; > > Begin > > For I := 1 To N Do > It generates an error: > Error: Ordinal expression expected > If I change it to LongInt, then it works, but the question is, why can’t I > use a Qword here if I know I

[fpc-pascal] TFPHttpClient & TFPHttpServer

2023-01-03 Thread duilio foschi via fpc-pascal
I would like to write some code where a TFPHttpClient component sends a minimal json payload to a TFPHttpServer that (reads the payload). The working of the TFPHttpClient component is clear enough, while its counterpart TFPHttpServer proves rather obscure to me. TFPHttpClient === Page

Re: [fpc-pascal] TFPHttpClient & TFPHttpServer

2023-01-03 Thread Mattias Gaertner via fpc-pascal
On Tue, 3 Jan 2023 23:58:42 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: >[...] > > Q4: TFPHTTPServer has property Address. I reckon it will be set to > > 'localhost' here. Is it correct? > > It depends on what you want. Best is to leave it empty. That will use 0.0.0.0, which is

Re: [fpc-pascal] Local Type T and generics

2023-01-03 Thread Sven Barth via fpc-pascal
Am 31.12.2022 um 14:34 schrieb Vojtěch Čihák via fpc-pascal: Hi, I have local type TTempItem, i.e. declared inside method of a generic class. When I write: type      TTempItem = record        Item: T;        Empty: Boolean;      end; I got: Identifier not found "T". When I write:

Re: [fpc-pascal] TFPHttpClient & TFPHttpServer

2023-01-03 Thread Michael Van Canneyt via fpc-pascal
On Tue, 3 Jan 2023, duilio foschi via fpc-pascal wrote: I would like to write some code where a TFPHttpClient component sends a minimal json payload to a TFPHttpServer that (reads the payload). The working of the TFPHttpClient component is clear enough, while its counterpart TFPHttpServer

Re: [fpc-pascal] TFPHttpClient & TFPHttpServer

2023-01-03 Thread duilio foschi via fpc-pascal
Now everything is clear. Thank you Peppe Il Mar 3 Gen 2023 22:59 Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> ha scritto: > > > On Tue, 3 Jan 2023, duilio foschi via fpc-pascal wrote: > > > I would like to write some code where a TFPHttpClient component sends > > a

Re: [fpc-pascal] Local Type T and generics

2023-01-03 Thread Vojtěch Čihák via fpc-pascal
OK, done: https://gitlab.com/freepascal.org/fpc/source/-/issues/40085   Thanks __ Od: "Sven Barth via fpc-pascal" Komu: "FPC-Pascal users discussions" Datum: 03.01.2023 22:29 Předmět: Re: [fpc-pascal] Local Type T and generics Am

Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2023-01-03 Thread Dwight Schauer via fpc-pascal
Pascal is still limited with OpenAI ChatGPT unless you stick to very core things in Pascal, and are patient to teach it about non-core things. Limited compared Python and other languages. Asking it to do specific things Python using standard modules give better results C++ with something like

Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2023-01-03 Thread Anthony Walter via fpc-pascal
Dwight, your experiences mirrored mine. In summary, while OpenGPT is obviously imperfect, generally it feels like a revolutionary leap forward of several magnitudes. It ought to be plainly clear that the proverbial toothpaste is now out of the tube and there is no going back. These types of

Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2023-01-03 Thread Dwight Schauer via fpc-pascal
On 1/3/23 11:17, Anthony Walter via fpc-pascal wrote: In summary, while OpenGPT is obviously imperfect, generally it feels like a revolutionary leap forward of several magnitudes. It ought to be plainly clear that the proverbial toothpaste is now out of the tube and there is no going back.

Re: [fpc-pascal] TFPHttpClient & TFPHttpServer

2023-01-03 Thread Michael Van Canneyt via fpc-pascal
On Wed, 4 Jan 2023, Mattias Gaertner via fpc-pascal wrote: On Tue, 3 Jan 2023 23:58:42 +0100 (CET) Michael Van Canneyt via fpc-pascal wrote: [...] Q4: TFPHTTPServer has property Address. I reckon it will be set to 'localhost' here. Is it correct? It depends on what you want. Best is to

Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Hairy Pixels via fpc-pascal
> On Jan 3, 2023, at 8:39 PM, Marc Weustink via fpc-pascal > wrote: > > On what instance/variable/piece of memory would your code > "TMyObject.Create(['1', '2', '3'])" then operate ? There’s a global stack which is opened and they are stored there during construction. Regards, Ryan Joseph

Re: [fpc-pascal] Open array in object constructor gives error

2023-01-03 Thread Sven Barth via fpc-pascal
Hairy Pixels via fpc-pascal schrieb am Mi., 4. Jan. 2023, 02:40: > > > > On Jan 3, 2023, at 8:39 PM, Marc Weustink via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > On what instance/variable/piece of memory would your code > "TMyObject.Create(['1', '2', '3'])" then operate ? > >