Re: [fpc-pascal] Read Field names from VMT

2024-01-21 Thread Michael Van Canneyt via fpc-pascal
On Sun, 21 Jan 2024, Amir--- via fpc-pascal wrote: How can I set the value? I tried something like Test := TTest.Create Ptr := Pointer(Test); TSub(Ptr+8) := TSub.Create; But it is not working? Depending on your platform, it can be an alignment issue. Use function

Re: [fpc-pascal] Read Field names from VMT

2024-01-21 Thread Amir--- via fpc-pascal
How can I set the value? I tried something like Test := TTest.Create Ptr := Pointer(Test); TSub(Ptr+8) := TSub.Create; But it is not working? You can use the PVmtFieldTable and PVmtFieldEntry types from the TypInfo unit: === code begin === program tfield; {$mode objfpc}{$H+} uses  

Re: [fpc-pascal] Nested comments.

2024-01-21 Thread Adriaan van Os via fpc-pascal
Guillermo Martínez Jiménez via fpc-pascal wrote: Hi Pascaloids, I'm wondering if it is possible to make FPC detect and warn (or even stop compillation when) it has detect a nested comment. That's because I'm using Vim and it closes odd comments. For example, the nex code: { This comment

Re: [fpc-pascal] Nested comments.

2024-01-21 Thread Tomas Hajny via fpc-pascal
On 2024-01-21 13:21, Guillermo Martínez Jiménez via fpc-pascal wrote: Hi, I'm wondering if it is possible to make FPC detect and warn (or even stop compillation when) it has detect a nested comment. That's because I'm using Vim and it closes odd comments. For example, the nex code: { This

[fpc-pascal] Nested comments.

2024-01-21 Thread Guillermo Martínez Jiménez via fpc-pascal
Hi Pascaloids, I'm wondering if it is possible to make FPC detect and warn (or even stop compillation when) it has detect a nested comment. That's because I'm using Vim and it closes odd comments. For example, the nex code: { This comment isn't closed. *) DoSomething (); { This is a nested