Hello X# Community,
I would like to use constructor chaining that means one constructor in a class should call another constructor with different arguments.
I found an old post by Robert from 2016.
So is calling Self() still the only option?
I would prefer the C# style like:
Constructor(strDateiname As String) : Self()
But its not urgent since right now I am using a second parameter with a default value.
Kind regards,
Peter
X# syntax for constructor chaining
X# syntax for constructor chaining
Peter,
The C# syntax is not allowed.
What we allow is:
What you could do (using the ; statement delimiter)
Robert
The C# syntax is not allowed.
What we allow is:
Code: Select all
Constructor(strDateiname As String)
Self()
Code: Select all
Constructor(strDateiname As String) ; Self()
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu