wolfie78uk
Programmer
In C++ functions can be 'overloaded' (i.e two functions share the same name but recieve different parameters and behave differently). This doesn't seem to be possible in VB.
Rather than making a mess of the application that I am building, I have created the following code to test it :
Private Sub cmdNo_Click()
Call ShowNumber
End Sub
Private Sub cmdWith_Click()
Call ShowNumber(25)
End Sub
Private Sub ShowNumber()
lblShow.Caption = "No parameters received"
End Sub
Private Sub ShowNumber(ByVal Number As Integer)
lblShow.Caption = "Parameter received is " & Number
End Sub
It doesnt even run. I recieve the error "Compile Error : Ambiguous name detected : ShowNumber.
It is not the end of the world if this can't be done but if it can be I would prefer to use it.
Cheers.
Rather than making a mess of the application that I am building, I have created the following code to test it :
Private Sub cmdNo_Click()
Call ShowNumber
End Sub
Private Sub cmdWith_Click()
Call ShowNumber(25)
End Sub
Private Sub ShowNumber()
lblShow.Caption = "No parameters received"
End Sub
Private Sub ShowNumber(ByVal Number As Integer)
lblShow.Caption = "Parameter received is " & Number
End Sub
It doesnt even run. I recieve the error "Compile Error : Ambiguous name detected : ShowNumber.
It is not the end of the world if this can't be done but if it can be I would prefer to use it.
Cheers.