I had a field called "fDATA2" containing some text:
"A man who had been soaked in water, and smothered in mud, and"
as one does

Code: Select all
on mouseUp
repeat until the last word of fld "fDATA2" is "water"
if the last word of fld "fDATA2" is "water" then
--do nix
else
delete the last word of fld "fDATA2"
end if
wait 20 ticks
end repeat
end mouseUp
Why, forbye?
Because LiveCode did not 'see' the word "water", it did, however 'see' the word "water,", which
was a right pain in the bum because . . .
Any text analysis program I write to do this sort of thing will have to trawl its way through
a textField bunging spaces before any punctuation marks.