InStr Documentation Error

To anyone who has the authority to update the online documentation, the documentation for InStr needs to be corrected.

The sections highlighted in yellow show the information that is incorrect. The default for “start”, if omitted, is Zero not One. The example highlighted in the note section should say that it returns 0 not 1.

As you can see below, the tip that is shown in the status bar is correct.

To quickly verify this, you can cut and paste the code below:

Dim s As String = "This is a test"
Call MsgBox( _
    "Dim s as string = ""This is a test""" + EndOfLine + _
    EndOfLine + _
    "s.InStr( """" )" + EndOfLine + _
    "Result = " + Str( s.InStr( "" ) ) + EndOfLine + _
    EndOfLine + _
    "InStr( ""This is a test"", """" )" + EndOfLine + _
    "Result = " + Str( InStr( "This is a test", "" ) ), _
    0, "InStr Example" _
    )

For anyone that was going to suggest entering this in Feedback, I don’t have the Feedback application installed. I rarely use RS and have no interest in upgrading to Xojo. So consider this post a benevolent gesture to the community because I noticed the inaccurate information in the Wiki. If a Feedback needs to be entered, then someone more invested in the documentation being correct can enter it.

Good day!

Perhaps you are looking at some old documentation as the current docs show the proper info.

Thanks, Randy. I’ve updated the page.