473,326 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Function Overloading in ASP.NET?

Hey, Simple question. Can I do this?

Function MyFunction()
##Code##
End Function

Function MyFunction(ByVal myVar as myType)
##code##
End Function

That way, I can call "MyFunction" and pass it a variable if I have one,
and call it without one if I don't? I know some languages hate this,
but I came from C++ which "loves" it. Does anyone know if this is
allowed?

Thanks,
Kivak Wolf

Nov 19 '05 #1
2 915
Wouldn't this be easy to try?

In any case, yes both C# and VB have overloading. VB doesn't force you to
declare a return type for a function, but you should. Something like:

Function MyFunction() As SomeType

"Kivak Wolf" <Li**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
Hey, Simple question. Can I do this?

Function MyFunction()
##Code##
End Function

Function MyFunction(ByVal myVar as myType)
##code##
End Function

That way, I can call "MyFunction" and pass it a variable if I have one,
and call it without one if I don't? I know some languages hate this,
but I came from C++ which "loves" it. Does anyone know if this is
allowed?

Thanks,
Kivak Wolf

Nov 19 '05 #2
Yes, I ended up trying myself after I posted. But thanks alot. =) It
works just fine.

Kivak Wolf

Nov 19 '05 #3

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

Similar topics

7
by: Doran_Dermot | last post by:
Hi All, I've seen lots of code in which the attributes of a class are accessed and modified using two separate methods. For example: class Problems: def __init__( self, refNum ):...
4
by: Dave Theese | last post by:
Hello all, I'm trying to get a grasp of the difference between specializing a function template and overloading it. The example below has a primary template, a specialization and an overload. ...
16
by: WittyGuy | last post by:
Hi, What is the major difference between function overloading and function templates? Thanks! http://www.gotw.ca/resources/clcm.htm for info about ]
39
by: zeus | last post by:
I know function overloading is not supported in C. I have a few questions about this: 1. Why? is it from technical reasons? if so, which? 2. why wasn't it introduced to the ANSI? 3. Is there any...
45
by: JaSeong Ju | last post by:
I would like to overload a C function. Is there any easy way to do this?
7
by: asdf | last post by:
They looks so similar. Anybody would like to tell me their differences? Thanks a lot.
15
by: lordkain | last post by:
is it possible to do some kind of function overloading in c? and that the return type is different
10
by: subramanian100in | last post by:
The following is a beginner's question. Suppose TYPE1 and TYPE2 are two types for which suitable ctors and operator= are defined. Suppose I have class Test { TYPE1 mem1;
10
by: Matthew | last post by:
Am I correct in thinking there is no method/function overloading of any kind in any version of PHP? Thanks, Matthew
14
by: mesut | last post by:
hi colleagues, I don't know if this is the right group for but it's in C# so I try. I have a #3 procedural function called GetInfo.. and those are 3 overloaded methods. I would like to use the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.