problem with counting words

Kay C Lan lan.kc.macmail at gmail.com
Tue Oct 14 03:45:47 EDT 2014


On Tue, Oct 14, 2014 at 2:03 AM, Peter Haworth <pete at lcsql.com> wrote:

> There's a qcc enhancement request out there for a new chunk type ("chunk")
> along with a "delimited by" clause.
>
> On Mon, Oct 13, 2014 at 7:32 AM, Terence Heaford <t.heaford at btinternet.com
> >
> wrote:
>
> > set the wordDelim to space
> > set the wordDelim to “*”
> >
> > Initally set to space, resets to space at the end of a handler.
> >
>

Nnnnooooo!

What is the point of a chunk or a word if it is only delimited by a single
character? It is identical to an item!

set the itemDelimiter to space
put the number of items into tCount.

How is that any different from:

put the number of chunks delimited by space of field "xyz" into tCount

OR

set the wordDelim to space
put the number of words into tCount

And the last thing we want is the wordDelimiter to be defaulted to
space!!!!! That would break so many scripts.

The great thing about word and token is they are NOT items. Items are
delimited by any single character you want, but that is their limitation, a
single character. A word, a trueWord (>= LC7) and a token are not delimited
by a single character but by a range of one or more characters which have
been predefined.

If you want something new... a chunk, then the ability to specify it's
delimiter as a range of characters that are either single of combined
*could* be a valid enhancement.

* Haven't really thought about it enough to come up with drawbacks, all I
know is I DON'T want the wordDelim to be a space and to create another
chunk type that is identical to an item seems counter productive to me.



More information about the use-livecode mailing list