what's wrong with this statement

Have a method with a passed parameter defined by: “sEventDesc As String”
in the method I define a variable: “dim i As Integer”

The statement i = sEventDesc.IndexOf(“Petitioned”) compiles without error

The statement i = sEventDesc.IndexOf(“Petitioned”, ComparisonOptions.CaseInsensitive) generates the following compile error:

There is more than one method with this name but this does not match any of the available Signatures.

Using Xojo 2019 r2.1

I would guess you also need the locale parameter if you add the comparison option. Try adding Locale.Current to the statement.

you need the start position parameter event though its got a default
This works
i = sEventDesc.IndexOf(0,“Petitioned”, ComparisonOptions.CaseInsensitive)

thanks Norman

It looks like a bug: https://documentation.xojo.com/api/data_types/string.html#string-indexof (last line of sample code)

I hope they can change it and keep the start position optional even if ComparisonOptions is used.

you could add your own extensions of string and make it so your initial usage just worked

   function indexof(extends source as string, strToFind as string, options As ComparisonOptions = ComparisonOptions.CaseInsensitive, locale as Locale = nil) As Integer

and this one internally might just do

return String.IndexOf(0, strToFind As String, options , locale )