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 "FreeAndNil(

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 outside