Is there any way to search for items and ignore apostrophes?
I'm attempting to do this:
Code: Select all
if "USA" is among the items of line z of goodDemo then
add 1 to numUSA
end if
Any workaround here?
Thank you!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Code: Select all
if "USA" is among the items of line z of goodDemo then
add 1 to numUSA
end if
Code: Select all
...
if "USA" is among the truewords of line z of goodDemo then
add 1 to numUSA
end if
...
Code: Select all
on mouseup
repeat with lnX = 1 to the number of lines in field "lstGoodDemo"
put ReplaceText(line lnX of field "lstGoodDemo",quote,empty) into lcText
if "USA" is among the items of lcText then
add 1 to lnNum
end if
end repeat
put lnNum
end mouseup
Code: Select all
else if "United States of America" is among the truewords of line z of goodDemo then
add 1 to numUSA
Code: Select all
put ReplaceText(line z of goodDemo,quote,empty) into line z of goodDemo
else if "United States of America" is among the items of line z of goodDemo then
add 1 to numUSA
Yes! I had assumed the solution might apply to everything.Klaus wrote:Yes, as its name suggests, it will only work with WORDS.
And that was your original question.![]()
Maybe you better use "contains" or "offset" or something like that?
What about this one?PoLyGLoT wrote:
Yes! I had assumed the solution might apply to everything.![]()
Given that I will probably never have thousands and thousands of lines,
I can use the replaceText solution that was offered.
Code: Select all
put "\b" & "USA" & "\b" into searchForUSA
repeat for each line T in field 1
if matchChunk( T, searchForUSA) then add 1 to n
end repeat