I'll rewrite the initial example. (...) And I'm asking whether there are any way that I can write: s := MyObj.AQMessage(100);
So, AQMessage is more like a class function than a property/field, isn't it?
Then why not just use it as a class function and delete AQMessage (or rename GetMessage() to AQMessage())? You don't have a single field for AQMessage (i.e. FAQMessage or something) so it shouldn't be a property.
Title: Re: Default values in property?
Post by: KodeZwerg on March 29, 2023, 11:49:46 am
Make your arguments as properties and use AQMessage without any arguments, inside GetMessage use fields from the properties (overload that method to either being a getter or a standalone method)