double byte chars

Slava Paperno slava at lexiconbridge.com
Mon Jun 13 12:38:16 CDT 2011


Have you used 

set caseSensitive to true?

If it doesn't do what you want, you can always compare the decimal character
code points, 1072 for the lower case a, 1040 for the upper case A etc.

I do use "select after" in my fields with Russian/English text to set the
insertion point and have not noticed it being slow, but I have not used it
in a repeat loop, so I don't know the answer to that question. 

Slava


> -----Original Message-----
> From: use-livecode-bounces at lists.runrev.com [mailto:use-livecode-
> bounces at lists.runrev.com] On Behalf Of Lars Brehmer
> Sent: Monday, June 13, 2011 12:59 PM
> To: use-livecode at lists.runrev.com
> Subject: re: double byte chars
> 
> Thanks to all who replied. I finally got it right using UTF8.
> 
> Just one more question about this - does Rev unicode support not handle
case
> sensitivity? Or is there something I need to do? My scripts won't match a
word if
> it is capitalized, but my no- unicode apps of course do.
> It's not a huge tragedy if caseSensitive = false doesn't work, but it
would be nice.
> 
> While I was experimenting with workarounds I came upon something that I am
> very curious about. I was trying to handle this forward filter text
matching by
> first putting the text in question into invisible fields. The actual
script is matching
> texts stored in custom properties. I know using text is much slower but I
found
> something crazy slow.  In a script of about 600 lines, this is the
relevent part;
> 
>      if item 16 in Q <> empty then
>         repeat with g = 16 to 22 step 2
>           put item g in Q into fld "expTemp"
>           repeat with i = 1 to the num of words in fld "expTemp"
> 
>             if item 1 in Q is not in eOutput then
>               put empty into fld "wordTemp"
>               select word i in fld "expTemp"
>               copy
>               --select after text of fld "wordTemp"
>               paste
>               delete char 1 to 2 in fld "wordTemp"
>               if char 1 to tNum in fld "wordTemp" = fld "search" then
>                 put item 1 in Q & tab & item g in Q & tab & g & cr after
eOutput
>               end if
>             end if
> 
>           end repeat
>         end repeat
> 
> the inactive line --select after text of fld "wordTemp"-- causes glacial
slowness
> when it is active. When it is inactive, the entire script runs to the end
in about
> 220 milliseconds, but of course doesn't deliver the desired result. This
is in
> comparison to about 35 milliseconds using your unicode suggestions, which
I am
> very pleased with. But if that line is active, I do get the desired
results, but it
> takes 34 SECONDS!
> 
> So out of curiousity, how can inserting the cursor in an empty field add
34
> seconds to a simple script? The script is unusable of course, but for
future
> reference, just wondering.
> 
> Cheers,
> 
> Lars
> _______________________________________________
> 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