use-livecode Digest, Vol 250, Issue 1

David V Glasgow dvglasgow at gmail.com
Mon Jul 29 03:38:23 EDT 2024


Many thanks, I will definitely include this in my testing.

Cheers

David G

> On 28 Jul 2024, at 8:10 pm, Niggemann, Bernd via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi David,
> 
> Here is a script that lets you compare filter operations on lists or arrays. With and without unicode.
> 
> put it into a button and make a field "fRes" and hold down the option/alt key to test unicode, else it is ASCII.
> 
> -----------------------------------------------------
> on mouseUp
>   put 10000 into tHowMany
>   -- hold down optionKey/altKey to use unicode
>   put the optionKey is down into tUnicode
>   if tUnicode then
>      put "a horse is a horse,a chicken is a" &  \
>            " Höfuðborgarsvæðið,a dog is a dog" into tData ## with unicode
>   else
>      put "a horse is a horse,a chicken is a " &  \
>            "chicken,a dog is a dog" into tData ## without unicode
>   end if
> 
>   repeat  tHowMany
>      put any item of tData & cr after tCollect
>   end repeat
>   delete char - 1 of tCollect
> 
>   put tCollect into tList
>   put tCollect into tForArray
> 
>   if tUnicode then
>      put the milliseconds into t1
>      filter tList with "*Höfuðborgarsvæðið*" ## with unicode
>      put the milliseconds - t1 into tListTime
> 
>      put the milliseconds into t1 ## include split
>      split tForArray by return
>      -- put the milliseconds into t1 ## without split
>      filter elements of tForArray with "*Höfuðborgarsvæðið*" ## with unicode
>      combine tForArray by return
>      put the milliseconds - t1 into tArrayTime
>   else
>      put the milliseconds into t1
>      filter tList with "*dog*" ## without unicode
>      put the milliseconds - t1 into tListTime
> 
>      -- put the milliseconds into t1 ## include split
>      split tForArray by return
>      put the milliseconds into t1 ## without split
>      filter elements of tForArray with "*dog*" ## with unicode
>      combine tForArray by return
>      put the milliseconds - t1 into tArrayTime
> 
>   end if
>   put "Unicode: " & tUnicode & ", Lines: " & tHowMany & cr & "List: " &  \
>         tListTime & " ms" & cr & "Array: " & tArrayTime & " ms"  \
>         & cr & the long time into field "fRes"
> end mouseUp
> -----------------------------------------------------
> 
> Kind regards
> Bernd
> _______________________________________________
> 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