Is it possible to create a function that can be used passing it a couple of parameters, or something different instead, without writing it twice?
For instance, if I had a function that needed and X and Y value, could I create a function that could either accept two integers or a point variable?
Basically doing the following without writing it twice, hoping for something cleaner.
Public Function MyLocation(ByVal X as Integer, ByVal Y as Integer)
Do Stuff
Return Stuff
End Sub
Public Function MyLocation(ByVal here as Point)
Do Stuff
Return Stuff
End Sub
For instance, if I had a function that needed and X and Y value, could I create a function that could either accept two integers or a point variable?
Basically doing the following without writing it twice, hoping for something cleaner.
Public Function MyLocation(ByVal X as Integer, ByVal Y as Integer)
Do Stuff
Return Stuff
End Sub
Public Function MyLocation(ByVal here as Point)
Do Stuff
Return Stuff
End Sub
Last edited: