codepointProperty

Richmond richmondmathewson at gmail.com
Fri Apr 4 13:47:43 EDT 2014


On 04/04/2014 20:30, Richmond wrote:
> <snip>
>>
>> at which point I discovered a GENERAL FIELD PROBLEM with 7.0.dp 1 
>> under UbuntuStudio 14.04 beta:
>>
>> <snip>
>
> Nipped over to Mac OS 10.6.7 [I love VMware, I love VMware, I love 
> VMware] I found that
> the problem I mentioned with 7.0. dp 1 on Ub-Linux is NOT a problem in 
> Mac 10.6.7
>
> So, checking out "codepointProperty" in the Dictionary [AND, I am very 
> happy to say, the
> Dictionary seems more up-to-date than it has been for years] I read this:
>
> "This function is not intended for general-purpose use; please use 
> functions such as toUpper or
> the is operators instead."
>
> Apart from the fact that a bit of bold text might not have been a bad 
> idea both for 'toUpper' and
> even more for 'is'; I wonder why 'codepointProperty' is not for 
> general-purpose use (it is stated without
> any explanation) as it looks an extremely useful tool . . .
>
> For the sake of argument . . .
>
> Here I am fooling around in the Old Cyrillic combining characters (as 
> one does on a regular basis),
> Unicode range HEX 2DE0 - 2DFF, DEC 11744 - 11775. Now these are, quite 
> frankly, totally whacked-out characters used in texts such as Paisii 
> Hilendarski's /Istoriya Slavyanobolgarskaya /as jazzy super-textual 
> characters riding above the normal text, rather like the way similar 
> characters were used in Madiaeval English court hand.
>
> Now I want to see what 'class' the Unicode Bunch (err, Consortium) 
> have dumped these combining characters into, as this may be useful 
> when one considers how various Operating system level key layouts may 
> handle them
> on, say, Windows and/or Macintosh.
>
> However, as I found out a few days ago [blast, Richmond has a week's 
> holiday], at the moment one seems unable to do this sort of thing:
>
> put the codepointProperty( quote & (numToChar(11746) & quote, "Diacritic")
>
> even though, the scriptEditor passes that, on attempted execution one 
> gets this:
>
> button "Button": execution error at line 2 (codepointProperty: bad 
> codepoint), char 1
>
> while this works on Mac OS 10.6.7:
>
> put codepointProperty(numToChar(11746), "Diacritic")
>
> and this works:
>
> on mouseUp
>    put 11744 into XXXXX
>    repeat until XXXXX = 11776
>       put codepointProperty(numToChar(11746), "Diacritic") into line 
> (XXXXX - 11743) of fld "fRESULTS"
>       put XXXXX + 1 into XXXXX
>       end repeat
> end mouseUp
>
> as soon as one tries to be both clever and useful with something like 
> this:
>
> on mouseUp
>    put 11744 into XXXXX
>    repeat until XXXXX = 11776
>       set the useUnicode to true
>       put numToChar(XXXXX) && codepointProperty(numToChar(11746), 
> "Diacritic") into line (XXXXX - 11743) of fld "fRESULTS"
>       put XXXXX + 1 into XXXXX
>       end repeat
> end mouseUp
>
>  we get this:
>
> button "Button": execution error at line 5 (codepointProperty: bad 
> codepoint), char 1
>
> So not entirely satisfactory.
>
> Richmond.
>
>

And, here we go again; eating my own tail, a.k.a. replying to my own 
posting.

This works:

on mouseUp
    put 11744 into XXXXX
    repeat until XXXXX = 11776
       set the useUnicode to true
       put numToCodepoint(XXXXX) && "/" && XXXXX && "/" && 
codepointProperty(numToCodepoint(11746), "Diacritic") into line (XXXXX - 
11743) of fld "fRESULTS"
       put XXXXX + 1 into XXXXX
       end repeat
end mouseUp

BUT this did NOT:

on mouseUp
    put 11744 into XXXXX
    repeat until XXXXX = 11776
       set the useUnicode to true
       put numToChar(XXXXX) && "/" && XXXXX into line (XXXXX - 11743) of 
fld "fRESULTS"
       put XXXXX + 1 into XXXXX
       end repeat
end mouseUp

"numToChar" produced ASCII chars.

Does this mean that "numToChar" has gone west?

Richmond.




More information about the use-livecode mailing list