|
-
Sep 28th, 2004, 05:52 PM
#1
Thread Starter
Frenzied Member
Holy Crap My Memory is bad!
What is it called when you have two functions whose declarations are almost alike except that they deal with different objects?
Like you could have
Public Function1 (Dim obj as Object)
Public Function1 (Dim str as String)
what do you have to put before the second function1???
thanx,
squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
Sep 28th, 2004, 05:54 PM
#2
You shouldn't have to put anything. Its called Overloading.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 28th, 2004, 05:55 PM
#3
Thread Starter
Frenzied Member
Well heck.. I just tried it and I don't need anything... What in the world am I thinking of?
squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
Sep 28th, 2004, 05:56 PM
#4
Thread Starter
Frenzied Member
LOL.. thanks man... i didn't refresh my browser before posting... heh.. guess I should have done that..
Yeah, overloading... It's been forever since i've taken C++
Thanks again,
squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
Sep 28th, 2004, 07:44 PM
#5
Frenzied Member
Originally posted by squirrelly1
LOL.. thanks man... i didn't refresh my browser before posting... heh.. guess I should have done that..
Yeah, overloading... It's been forever since i've taken C++
Thanks again,
squirrelly1
If I remember my C++ days (And I am not guaranteeing that I do ) but if you want to overload correctly you need to change the quantity of options not the type..
like this:
VB Code:
Public Function1 (obj as Object)
Public Function1 (obj as Object, str as String)
Plus I don't think the Dim is a good thing to do.. But in .NET it could all be different rules...
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Sep 28th, 2004, 08:36 PM
#6
Thread Starter
Frenzied Member
yeah, i didn't copy that code... ordinarily, it woudl be a ByVal or ByRef if I remember correctly...
thanks guys,
squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|