473,507 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overridable functions

Hello,
I have an overridable function in a base class (to do some basic
database works) that gets inherited by many concrete classes. These
concrete classes expands the work of that overridable function, my
question is is why VB.net includes "Return" keyword in the concrete
classes when the overridable function is called, i.e., I end up with
two Return keywords, one for the overridable function and the other
for the conrete class's function?


MTIA,
Grawsha

May 17 '07 #1
3 2049
Can you post some code? I don't quite understand the problem.....
May 17 '07 #2
On May 17, 7:21 pm, grawsha2...@yahoo.com wrote:
Hello,

I have an overridable function in a base class (to do some basic
database works) that gets inherited by many concrete classes. These
concrete classes expands the work of that overridable function, my
question is is why VB.net includes "Return" keyword in the concrete
classes when the overridable function is called, i.e., I end up with
two Return keywords, one for the overridable function and the other
for the conrete class's function?

MTIA,
Grawsha

Just figured it out!!
Since the overridable function in the base class does basic work and
actually returnes no values, then leaving the more complicated work
that result in a returned value to the concrete function, I just
remove the first Return keyword that precedes the Mybase.function
statements.

May 17 '07 #3
I think the Return MyBase.Func () is put there by auto-complete for
convenience.
Robin
May 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3414
by: Marina | last post by:
Hi, I have a class that inherits from CollectionBase, and I'm trying to override its Count property. As per the documentation, this property is overridable - so I should be able to do this. So...
2
2707
by: H | last post by:
Here is a good one!! A book I am reading on OOP states 'If any method is marked to allow overriding, the access can be changed by a derived class.' Also 'A derived class can even change...
1
3365
by: bminder | last post by:
In the asp.net pages below, Common.vb has an overridable Page_Load sub. In the consuming page, Two.aspx, the Page_Load sub is inherited, but for some reason it (Overrides Sub Page_Load) executes...
1
1972
by: steve kain | last post by:
Hi. I'm just wondering how come the compiler complains when you declare a new sub as overridable but it then lets you define multiple new subs with different interfaces, essentially overriding...
3
2308
by: dbuchanan | last post by:
Why can't I add the 'Overridable' key word to any of the methods or events in my base class? VB.NET thinks I am trying to define a variable. What am I doing wrong? I get the squiggly line under...
2
1373
by: MDFS | last post by:
Hi, I was wondering if anyone has any information on the performance impact of using functions declared as overridable? To Explain more fully; By default every function created in VB is NOT...
5
1983
by: Dilip | last post by:
In a polymorphic hierarchy is it common practice to have public virtual functions in the base class with a default empty implementation and let the derived classes decide whether they want to...
5
1451
by: Ben | last post by:
Hi, i defined a function in the base class 'ford' and the same function (with different output) in subclass "peugeot". I first put 'Overridable function' in the base class and 'Overrides...
0
1021
by: Internet User | last post by:
According to MSDN, You should never base the security of your application on a member that is marked with the internal virtual modifier in C# (the Overloads Overridable Friend modifier in Visual...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.