Home > Available Help Files > PC-DMIS BASIC Language > Language Reference A – Z > InStr Function > Example - InStr Function
Current Help File: PC-DMIS Basic (View Core Help)
Example - InStr Function
Sub Main ()
myStr = "Good Bye and Bye Again"
myLoc1 = InStr(1, myStr, "Bye") ' returns the position of the first occurrence
myLoc2 = Instr(10, myStr, "Bye") ' returns the position of the second occurrence
MsgBox "Found string at location " & myLoc1 & ".", 64, "String Found"
MsgBox "Found string at location " & myLoc2 & ".", 64, "String Found"
End Sub