Word counter crashing LiveCode?

Keith Clarke keith.clarke at me.com
Sat Aug 25 07:53:03 EDT 2018


Thanks Alex & Paul - that’s working nicely now.

It has also introduced me to:
A unicode text subtlety that I’d missed since I last dabbled with LiveCode pre-7
Arrays, with a useful worked example, which are clearly more efficient for this kind of process but a learning curve that I’d been avoiding ;-)

Best,
Keith

> On 25 Aug 2018, at 12:04, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 
> 
> On 25/08/2018 12:01, Alex Tweedly via use-livecode wrote:
>> Not sure why yours is crashing, and I admit I haven't really looked closely :-)
>> 
>> I have a similar word count - so I tweaked it slightly :
>> 
>>  - stack with 3 fields - fNoiseWords, fSource and outputs results to "F"
>> 
>>  - button to make it run
> Sorry - stupid formatting.
> Try again:
> 
> on mouseUp
>    local tSource, tNoise, tWords
>    local tANoise, tAWords
>    put the text of fld "fSource" into tSource
>    put the text of fld "fNoise" into tNoise
>    repeat for each word W in tNoise
>       put true into tANoise[W]
>    end repeat
> 
> 
>    repeat for each word W in tSource
>       if tANoise[W] then next repeat
>       add 1 to tAWords[W]
>    end repeat
> 
>    repeat for each key K in tAWords
>       put K && tAWords[K] &CR after fld "F"
>    end repeat
> end mouseUp
> 
> Alex.
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list