Thank you for the help, I'll give it a try!
James
-Original Message-
From: fpc-pascal On Behalf Of Jean
SUZINEAU via fpc-pascal
Sent: Tuesday, September 8, 2020 8:47 AM
To: fpc-pascal@lists.freepascal.org
Cc: Jean SUZINEAU
Subject: Re: [fpc-pascal] Help with TList example
Another way
> On Sep 8, 2020, at 6:10 PM, James Richters via fpc-pascal
> wrote:
>
> I'm trying to figure out how TList works. I found the code example below by
> doing a search, but I can't compile it, I get Error: Illegal qualifier on
> the line
Do you want an array of pointers (objects
Another way is to declare TMyRec as class instead of record.
In this case, you don't need theĀ dereference operator ^ .
No need of new and dispose, just Create and Free, as for TMyRecList.
I don't know if there is a better performance when you use a record,
but as far as I know,
Of Tony
Whyman via fpc-pascal
Sent: Tuesday, September 8, 2020 7:21 AM
To: fpc-pascal@lists.freepascal.org
Cc: Tony Whyman
Subject: Re: [fpc-pascal] Help with TList example
Two observations:
1. In Pascal you should use "new" and "dispose" to allocate and deallocate
recor
: Tony Whyman
Subject: Re: [fpc-pascal] Help with TList example
Two observations:
1. In Pascal you should use "new" and "dispose" to allocate and deallocate
record types - not GetMem and FreeMem.
2. MyRec is a pointer type and you should code the line as
MyRec^.Value := tmp
Two observations:
1. In Pascal you should use "new" and "dispose" to allocate and
deallocate record types - not GetMem and FreeMem.
2. MyRec is a pointer type and you should code the line as
MyRec^.Value := tmp
On 08/09/2020 12:10, James Richters via fpc-pascal wrote:
I'm trying to figure
I'm trying to figure out how TList works. I found the code example below by
doing a search, but I can't compile it, I get Error: Illegal qualifier on the
line
MyRec.Value := tmp;
It's indicating the error is on the V of Value
I tried commenting that line out, then I get the same error