Hello,
I'm having difficulty overloading some methods, and I think I'm doing something wrong setting them up. I have two basic subs I'm using to learn how to do this, but I'm getting an "Ambiguous Name Detected" error. The code is as follows:
and I'm testing it like this
I've tried adding "Overloads" in each sub declaration, as follows
But then I get an "Expected: Expression" error popping up
I've also tried using the following code to test it
From what I can find online here and on Microsoft's support website, I'm doing the right thing but it still isn't working. (there's a reason I'm an engineer and not a programmer).
Any help would be greatly appreciated.
Thanks!
I'm having difficulty overloading some methods, and I think I'm doing something wrong setting them up. I have two basic subs I'm using to learn how to do this, but I'm getting an "Ambiguous Name Detected" error. The code is as follows:
Code:
Sub tester()
MsgBox ("in the tester")
End Sub
Sub tester(a As Integer)
MsgBox ("in the tester" & a)
End Sub
and I'm testing it like this
Code:
tester
tester 12
I've tried adding "Overloads" in each sub declaration, as follows
Code:
Overloads Sub tester()
MsgBox ("in the tester")
End Sub
Overloads Sub tester(a As Integer)
MsgBox ("in the tester" & a)
End Sub
But then I get an "Expected: Expression" error popping up
I've also tried using the following code to test it
Code:
tester ()
tester (12)
From what I can find online here and on Microsoft's support website, I'm doing the right thing but it still isn't working. (there's a reason I'm an engineer and not a programmer).
Any help would be greatly appreciated.
Thanks!