Results 1 to 6 of 6

Thread: Holy Crap My Memory is bad!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    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?

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026
    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?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026
    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?

  5. #5
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    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:
    1. Public Function1 (obj as Object)
    2. 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".

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026
    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
  •  



Click Here to Expand Forum to Full Width