This program below crashes because the value 12 is not in the enum. I was
curious though, how does it know this? Does it have to do a linear search
through the enum to find the value? I know "succ" fails at compile time because
the enum has assignments but how this works at runtime is another qu
You may find that compiling with "{$OBJECTCHECKS OFF}" allows your
program to run and as long as your object has no virtual methods nor
does it require its fields to be initialised to zero, then it might even
give a useful result - otherwise, you also need to call InitInstance.
On 04/06/2024
Could it be because you do not zero out the allocated memory?
Le 04/06/2024 à 10꞉54, Hairy Pixels via fpc-pascal a écrit :
In the manual it athttps://www.freepascal.org/docs-html/ref/refse38.html it says
"Calling the constructor will provoke a call to the virtual class method
NewInstance, wh