2016-10-31 4:31 GMT+01:00 adamn...@gmail.com <adamn...@gmail.com>: > Probably a dq, but.. > Is it possible to write a method, apart from _read and _write, on a property > of a class? Specifically, I'd like to implement a boolean function to return > true if the property has a specific value. Something along the lines of > MyClass.MyDateProperty.IsFuture() which would return true if the current > value of the property is a date in the future? > There are obvious solutions along the lines of If > MyClass.MyDateProperty>Date(Now()), I'm just trying to shortcut coding common > checks in the client class. > > regards > Bruce
I your case MyDateProperty is not a property but a class Maybe if you create a new DateType that inneritate from Date and adding some analysis feature. --- MyDate Class--- inherit Date Public sub IsFuture() if super.value...... end --Your Class-- Property Date as MyDate So you can use like that MyClass.Date = Date(... If MyClass.Date.Future() then ... > -- > B Bruen <adamn...@gnail.com (sort of)> > > ------------------------------------------------------------------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user -- Fabien Bodard ------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user