; Instr Example ; ------------- ; Instr returns the position of a substring inside a string (1-based), ; or 0 if it is not there. An optional third parameter sets where the ; search starts - useful for finding repeated matches. save$="name=Robo;score=1250;level=7" Print "Save-file line: "+save$ Print "" ; Find the first '=' sign p=Instr(save$,"=") Print "First '=' is at position "+p ; Search again, starting just past the first match p2=Instr(save$,"=",p+1) Print "Next '=' is at position "+p2 ; A quick chat-command check chat$="/whisper Robo meet me at the gate" If Instr(chat$,"/whisper")=1 Then Print "Chat line starts with the /whisper command" ; A failed search returns 0 Print "Searching for 'lives' returns "+Instr(save$,"lives") Print "" Print "Press any key to close the example" WaitKey End