xsharp.eu • Where is SUPER?
Page 1 of 1

Where is SUPER?

Posted: Tue Dec 31, 2019 6:24 am
by rjpajaron
I can work without SUPER

But when I type SUPER: it supposed to door kick a combo box like when I type SELF.

So, let me this is valid statement:

Code: Select all

CLASS SubClass INHERIT SuperClass
	PROTECT Owner AS Window
	
CONSTRUCTOR(newData AS ARRAY)

	SUPER(newData)
	
	RETURN SELF

Where is SUPER?

Posted: Tue Dec 31, 2019 9:33 am
by Chris
Hi Rene,

Yes this is correct, you need to use the SUPER(<params>) syntax in order to invoke the parent constructor. If you do not supply one, the compiler will automatically include it, but the parent class needs to have a parameterless constructor for that to work.

And yes, when you type "SUPER:" in order to access a member of the parent class, you should get a completion list.

Where is SUPER?

Posted: Tue Dec 31, 2019 1:46 pm
by rjpajaron
Thanks Chris,

I have so much to learn... X# is not VO.

Where is SUPER?

Posted: Tue Dec 31, 2019 2:35 pm
by Chris
Hi Rene,

Well, "SUPER:" is the same as in VO, isn't it? Also actually you can also use SUPER:Init() to call the parent constructor, if you also enable the vo1 compatibility option in your project, but I think it's a good idea to do it the ".Net way", using the SUPER() syntax instead.

Where is SUPER?

Posted: Wed Jan 01, 2020 3:56 am
by rjpajaron
Got it!

.NET Way.... to go... it means also, I have a lot to tinker.... invest on time