> This is the situation: > > QTextCursor() is a class and :configure( xObject ) is its method resturning > self. > > In application code I have frequent calls like this: > > QTextDocument():configure( ::qEdit:document() ):setModified( .f. ) > / > OR > / > qDoc := QTextDocument():configure( ::qEdit:document() ) > qDoc:setModified( .t. ) > > I want to reduce code which must be eliminated as > > QTextDocument( ::qEdit:document() ):setModified( .f. ) > / > OR > / > qDoc := QTextDocument( ::qEdit:document() ) > qDoc:setModified( .t. ) > > But it GPFs because call QTextDocument() returns the class object itself. > So the above notation fails. I realize that this cannot be achieved like > this. > > Or you may forward another solution.
Sorry to jump in, but IMO this is not very good idea. This is like forcing "CONSTRUCTOR" or even worse "DEFAULT" methods to the class syntax. We don't have it for good reason (f.e. code readability). This can save some typing but the time is lost many times when others are trying to find out what the code actually does. Brgds, Viktor _______________________________________________ Harbour mailing list (attachment size limit: 40KB) [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
