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

2023-06-04 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 fRecIns

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

2023-06-04 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 member

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

2023-06-04 Thread Juha Manninen via fpc-pascal
OK, I understand mostly. Thanks. Juha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2023-06-04 Thread Martin Frb via fpc-pascal
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 members of the temp record (just to have the work thrown away afterwards). So I guess

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

2023-06-04 Thread Martin Frb via fpc-pascal
On 04/06/2023 15:04, Juha Manninen via fpc-pascal wrote: Why the following code fails to compile?   TMyRec = record ... property     RecInstance: TMyRec read fRecInstance;// write fRecInstance; ... MyObj.RecInstance.ii := 123; Access through property seems to be the problem. Accessing fRecI

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

2023-06-04 Thread Martin via fpc-pascal
On 04/06/2023 15:04, Juha Manninen via fpc-pascal wrote: Why the following code fails to compile?   TMyRec = record ... property     RecInstance: TMyRec read fRecInstance;// write fRecInstance; ... MyObj.RecInstance.ii := 123; Access through property seems to be the problem. Accessing fRecI

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

2023-06-04 Thread Juha Manninen via fpc-pascal
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 fRecInstance; and still get the same error. Juha

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

2023-06-04 Thread Mattias Gaertner via fpc-pascal
On Sun, 4 Jun 2023 16:04:48 +0300 Juha Manninen via fpc-pascal wrote: > Why the following code fails to compile? > > type > TMyRec = record > ss: String; > ii: Integer; > end; > TMyClass = class > private > fName: String; > fRecInstance: TMyRec; > property > RecInst

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

2023-06-04 Thread Juha Manninen via fpc-pascal
Formatting was a little weird. This is what I meant, but the error remains : type TMyRec = record ss: String; ii: Integer; end; TMyClass = class private fName: String; fRecInstance: TMyRec; public property RecInstance: TMyRec read fRecInstance;// write fRecInstance;

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

2023-06-04 Thread Juha Manninen via fpc-pascal
Compiler version is FPC 3.2.2 on Linux. Juha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

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

2023-06-04 Thread Juha Manninen via fpc-pascal
Why the following code fails to compile? type TMyRec = record ss: String; ii: Integer; end; TMyClass = class private fName: String; fRecInstance: TMyRec; property RecInstance: TMyRec read fRecInstance;// write fRecInstance; end; var MyObj : TMyClass; begin MyObj