word counts - what is going on?

J. Landman Gay jacque at hyperactivesw.com
Wed Aug 15 01:02:39 EDT 2012

On 8/14/12 10:39 PM, James Hale wrote:

> The problem with using the word chunk boils down to not being able to
> get quoted text seen as multiple words as in selecting a word within
> the quoted block using the word chunk command to say hilite it.

Some random thoughts:

Put a copy of the text into a variable.
Do a bulk replace on it: replace tab with space
Set the itemdelimiter to space
Repeat for each line: (track the line number here)
    repeat for each item in the line (these are "real" words)
      if the item contains the search word then...

You'll still get punctuation in the items, but you will have realistic 
line and item (i.e., word) counts.

When you need to actually deal with the hits (select them, display them, 
whatever,) you can parse out the punctuation.


Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

More information about the use-livecode mailing list