I do believe its wishfull thinking, but is it possible to make a virtual function in VB just like in C++?
I want my function to act differently depending on the type of parameter that I give her.
simplified exemple:
Code: Select all
Public sub Bitch(strBitch as string) as string
Bitch = strBitch + " yo!"
End sub
Public sub Bitch(intBitch as integer) as integer
Bitch = intBitch*2
End sub
Private Sub Form_Load()
dim strYo as string
dim intNo as integer
strYo = "Bitch!"
intNo = 2
msgbox Bitch(strYo) 'Would display "Bitch! Yo!"
msgbox Bitch(intNo) 'Would display 4
End Sub
What is missing in this code, if what i want is actually possible?
Thank you!