[Gambas-user] Class startup?

PICCORO McKAY Lenz mckaygerhard at ...626...
Thu May 18 17:39:25 CEST 2017


2017-05-18 11:23 GMT-04:00 Tobias Boege <taboege at ...626...>:

> Yes, they can be optional.
>
> If you use optional constructor arguments you have to be careful with
> inheritance, though! Along the inheritance lineage, all constructor
> arguments are divided into two camps: mandatory and optional arguments.
> When the final inherited constructor signature is computed, both camps
> are sorted separately with the elders' arguments first and then all the
> mandatory arguments precede the optional arguments, e.g.
>
>   ' Parent.class
>   Public Sub _new(ParentArg, ParentArg2, Optional ParentOpt)
>
>   ' Child.class
>   Inherits Parent
>   Public Sub _new(ChildArg, Optional ChildOpt)
>
> results in the following complete signature for Child._new():
>
>   _new(ParentArg, ParentArg2, ChildArg, ParentOpt, ChildOpt)
>
the signature now takes all the parameters?

umm seems now teste in gambas, the args of the child are alway behind of
the parents

but if the child have no args? the childs of childrens must have parent1
and 2?


>
> Note that the optional argument of the parent comes *after* the mandatory
> argument of the child. There is an extra section in the object model wiki
> page about this [1].
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/doc/object-model#t18
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list