Extends and Not Extends

I have a function that wraps text in single quotes like this:


Is there a way in Xojo to allow the function to extend as well as work like a ‘regular’ function like this?

myText = TextQuoteSingle( myText )

Sure, just declare it both ways and have one of them simply call the other.

Do I need to use different method names? I thought I saw something where we can have more than one method with the same name, but different params…

I’m ignorant on this. :frowning:

You can use the same name with different parameters (signatures). Using extends in one but not the other counts as a difference.

Thank you Kem!

And when doing this, have one version call the other version, so there’s only one set of code to keep current. Don’t copy & paste your code.