Re: [fpc-pascal] Function to create a record ?

2023-06-05 Thread Steve Litt via fpc-pascal
Jean SUZINEAU via fpc-pascal said on Mon, 5 Jun 2023 11:56:59 +0200 >Hello, I have a hard time trying to understand what you want to test. > >In your functions, you are using a record, not a class or a pointer to >record or an object. > >The personrecord just behave in your parameters and return

Re: [fpc-pascal] Function to create a record ?

2023-06-05 Thread Jean SUZINEAU via fpc-pascal
Oops, I hit "Send message" too quickly. The only difference in the second code is: - personrecord renamed to personclass and declared as "personclass = class" - "newp:= personclass.Create;" added in function newperson Of course for a clean code, you'll need to call something like

Re: [fpc-pascal] Function to create a record ?

2023-06-05 Thread Jean SUZINEAU via fpc-pascal
Hello, I have a hard time trying to understand what you want to test. In your functions, you are using a record, not a class or a pointer to record or an object. The personrecord just behave in your parameters and return value as an Integer or a String, and your fillchar doesn't write

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

2023-06-05 Thread Michael Van Canneyt via fpc-pascal
On Sun, 4 Jun 2023, Juha Manninen via fpc-pascal wrote: On Sunday, June 4, 2023, Mattias Gaertner via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: Correct. Property RecInstance is read only. No, I can define it as : property RecInstance: TMyRec read fRecInstance write

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

2023-06-05 Thread Sven Barth via fpc-pascal
Martin Frb via fpc-pascal schrieb am So., 4. Juni 2023, 18:10: > 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