Overridable functions

G

grawsha2000

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
 
G

grawsha2000

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.
 
R

Robin Tucker

I think the Return MyBase.Func () is put there by auto-complete for
convenience.


Robin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top