Speed up a slow loop

Jerry Jensen jerry at jhjensen.com
Wed Mar 2 22:06:27 EST 2022


That does make sense and now I understand the problem. 

> On Mar 2, 2022, at 6:19 PM, J. Landman Gay via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Actually, this is what I do:
> 
>  if sDictFile[L] = true then...
> 
> which I thought would be pretty fast since it's accessing the array directly. The array looks like this:
> 
> sDictFile
>  word1 -> true
>  word2 -> true
>  word3 -> true
> 
> And my loop does this, for each user word:
> 
>  if sDictFile["word2"] = true then...
> 
> so I'm not really looping through the keys, just looking for a matching one. The loop is for each user word I need to find. If there's no key, then the word isn't legal. I hope that makes sense.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________



More information about the use-livecode mailing list