Daniël Mantione wrote:
In 16 bit days it was considered acceptable to typecast pointers into records and just increase their offset. However, it was not portable. Making your code portable requires some effort. This kind of code is just one example of things you should not do in portable code. If Borland had
intended this as a pointer , they would have declared it as a pointer.

Of course there is a simple solution, derive a class and add fields to taste.

For non visual components it's simple, but for LCL/Visual components it's a bit more complicated if you plan to use them with the GUI designer: you will have to write a package and then install it. In other cases are worse. Look at the TPage example (which in fact was the motivation to suggest this modification since i want a place to store a pointer in it): i would have to write a TPage descendant and also modify the Lazarus IDE to use it when designing the GUI.

Luiz
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to