Adem schrieb:
On 2010-10-09 16:22, Hans-Peter Diettrich wrote:
The variables have been replaced by (getter) functions, with some
added procedures for updating their values - this is where
getter/setter pairs are inapplicable for structured types, or require
too many consequential changes for using pointers instead of plain
variables. If somebody can suggest a less intrusive solution, more
global variables can be moved.
Would you consider turning those structured types into objects?
This solution has some limitations. The conversion of a packed record
requires much coding, the fields can not be used as var parameters and
cannot be inc'ed etc. And then there is the time required to create and
destroy the objects. In former attempts I converted the getters to
return pointers instead of values, to overcome these problems, but then
*every* usage of such a variable has to be modified accordingly - what I
wanted to avoid this time.
Properties with getter/setter pairs would make tracing (placing a
breakpoint in the getter/sertter would help identify the caller) easier.
Static analysis is easier with different names for the "setters". In
many cases specialized setters can replace more than a single statement.
DoDi
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel