[Gambas-user] New syntactic sugar to define a property based on a global variable
chrisml at deganius.de
Thu Aug 22 15:22:15 CEST 2019
Am 22.08.19 um 14:28 schrieb Benoît Minisini:
> Property Name As String Use $name
> is equivalent to:
> Property Name As String
> Private $name As String
> Private Sub Name_Read() As String
> Return $name
> Private Sub Name_Write(Value As String)
> $name = Value
> Except that if you explicitly define your own Name_Read() or
> Name_Write(), it will override the one that is defined automatically by
> default (i.e. the automatic one is not generated).
> It's really just a feature for lazy people. :-)
Thank you for the explanation. It's also great because it makes the code
more compact and better readable.
As I always use a lot of properties, this is ultra-ultra-great! ;-)
It's just the compiler, right? If this code is compiled it can be
executed by an older interpreter? Say ... Gambas 3.9?
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: OpenPGP digital signature
More information about the User