[Gambas-user] Class startup?

PICCORO McKAY Lenz mckaygerhard at ...626...
Thu May 18 17:11:30 CEST 2017


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

> You can also specify parameters to the _new() method like
>
>   ' In MyClass.class:
>   Public Sub _new(X As Integer)
>     ' ...
>   End
>

a question: can be "Optional" allowed in constructor arguments..?

its possible, so its the same as override in C:

Public Sub _new(Optional x As String = "pepe")

  Print " es " & x

End

gambas its wonderfull....


> which demands that an Integer be given on object instantiation:
>
>   Dim h As New MyClass(10) ' X = 10
>
> Regards,
> Tobi
>
> [1] http://gambaswiki.org/wiki/cat/special
>
> --
> "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