Michael Clease
28-05-2007, 01:23
' Usage of the INSTR Keyword example
'
'
' Written by Abraxas
DIM MainString as String value "My nice long string with some nice words that repeat themselves which is nice"
DIM MatchString as string value "nice"
DIM sMsg as string value ""
DIM Startpos as dword value 0
DIM n as DWORD value 0
n = INSTR(StartPos, MainString, MatchString)
sMSG += "The number of times the word" & $CRLF & $CRLF
sMsg += MatchString & $CRLF & $CRLF
sMsg += "Appears = " & n & $CRLF & $CRLF
MsgBox 0, sMsg
'
'
' Written by Abraxas
DIM MainString as String value "My nice long string with some nice words that repeat themselves which is nice"
DIM MatchString as string value "nice"
DIM sMsg as string value ""
DIM Startpos as dword value 0
DIM n as DWORD value 0
n = INSTR(StartPos, MainString, MatchString)
sMSG += "The number of times the word" & $CRLF & $CRLF
sMsg += MatchString & $CRLF & $CRLF
sMsg += "Appears = " & n & $CRLF & $CRLF
MsgBox 0, sMsg