How about storing your bad words in lower case and converting your test
string to lower case before testing it:
on toLower sztxt
s = ""
repeat with i = the number of chars in sztxt down to 1
ch = chartonum(char i of sztxt)
if ch > 64 AND ch < 91 then
s = numtochar(ch + 32) & s
else
s = char i of sztxt & s
end if
end repeat
return s
end
myBadText = myBadText.toLower()
> I want to make a "bad-word-list" protection for my application.
> The text to compare is a string of several words. I was thinking of
> making a repeat-loop going through every word of the strring and compare
> it with a linear list using getOne.
> But I found out, that getOne (also findPos etc) are case-sensitive. This
> brings up a funny thing:
>
> a=["One", "Two", "Three"]
> put getPos(a,"Two")
> --2
> put getPos(a,"two")
> --0
> put a[2]="two"
> --1
>
> So I don't know if this makes sense, but I would have to do another
> repeat loop for list comparison.
> Second way: using a repeat loop with "contains" like
>
> if badWordCollection contains myBadText.word[i] then doBadStuffHere
>
> but then the word "as" would be bad, if badWordCollection contains "ass"
>
> The next approach is again do a second repeat loop to compare both
> strings word by word. I have not tested but since I know that Directors
> text management is not really fast...
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]