when overloading a method, what items make that a unique method that the compiler can determine which one to use? parameters? return value? I remember at some point @Joe Ranieri or @Norman Palardy told me but I cant find the posting and my memory is well not there.
function bob( extends s() as string, item as string )
function bob( extends s() as string, items() as string )
why cant I do something like stringArray.bob( newString ) and it figure out which one to use?
coding late on a friday is never a good thing. should be relaxing instead. but as most of you, I rather code Xojo than relax.
function bob( extends i as integer, number as integer)
function bob( extends i as integer, numbers() as integer)
function bob( extends i as double, number as double)
function bob( extends i as double, numbers() as double)
as when I tried to use anInteger.bob( number ) it told me it couldnt figure out which method to use. same with anDouble.bob( number )
Opps, I realized I misread. Ignore my previous post, but look at this screen shot. This works fine also. I’m not having any issues with Xojo resolving which method to call. All checks and runs fine. Sure there isn’t a typo in your code somewhere?
dim i as Integer = 10
dim d as Double = 10.5
dim iArray() as Integer = Array(10, 20)
dim dArray() as Double = Array(10.5, 20.5)
i.Bob(10)
i.Bob(iArray)
d.Bob(10.5)
d.Bob(dArray)
function bob(extends i as integer, number as integer)
function bob(extends i as integer, numbers() as integer)
function bob(extends i as integer, paramarray numbers() as integer)
Then Xojo will not know to call the first or 3rd method for
i.Bob(1)
If that was the problem, get rid of the first version of the method.
@Kem Tekinay I was not using a ParamArray (never used one before). I only had the 4 instances of the method “bob” (listed above).
I am about to take another freaking computer certification exam so I havent had time to look at this since yesterday afternoon. I will look at it again tomorrow (Sun) once I recover from tonight. Thanks everyone so far that has helped.