Word counter crashing LiveCode?

Alex Tweedly alex at tweedly.net
Sat Aug 25 07:04:46 EDT 2018



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.




More information about the use-livecode mailing list