Volkmaniac
Technical User
I'm using some code from a countitems script I took off this site. I was wondering if there was a way you can "match exact case" The problem I'm having is that it will count "CAP1" (below) twice because it's counting every instance of the characters. I tried reading the string length but it kept coming up as NULL. Is there anything I can do to ensure that the exact match will only be counted?
fopen 1 fname read text
While not feof 1
fgets 01 sLine
If strfind sLine "CAP1" MATCHCASE
A++
Endif
If strfind sLine "CAP1X" MATCHCASE
B++
Endif
strfmt Output "CAP1: %d" A
Termwrites Output
Termwrites "`n`r"
strfmt Output "CAP1X: %d" B
Termwrites Output
Termwrites "`n`r"
fopen 1 fname read text
While not feof 1
fgets 01 sLine
If strfind sLine "CAP1" MATCHCASE
A++
Endif
If strfind sLine "CAP1X" MATCHCASE
B++
Endif
strfmt Output "CAP1: %d" A
Termwrites Output
Termwrites "`n`r"
strfmt Output "CAP1X: %d" B
Termwrites Output
Termwrites "`n`r"