[fpc-pascal] Can property setters be procedures only?

Michael Van Canneyt michael at freepascal.org
Wed Feb 6 10:07:38 CET 2013



On Wed, 6 Feb 2013, Frank Church wrote:

> When I try to set a property using a function I get the error:
>
> form001.pas(28,64) Error: Illegal symbol for property access
> form001.pas(34,1) Fatal: There were 1 errors compiling module, stopping
>
> Is there something about properties that prevent them from being set
> by a function?

Yes, the absence of a result.
Results sometimes require special handling (strings etc).

> I can call a function to set that property, but I wonder why a setter
> can't be a function?

Because there is no result.

Where is the result in
  MyControl.Top:=3;
?


Michael.



More information about the fpc-pascal mailing list