clicktext and decimal numbers

Alex Tweedly alex at tweedly.net
Thu Jan 6 09:24:13 EST 2005


Klaus Major wrote:

> Hi friends,
>
> a happy 2005 to all of you!

Happy New Year to you too. 

> Short question:
>
> When clicking on decimal numbers like 12.34, "the clicktext"*** returns
> "12", "." or "34", which is not very helpful if you need the complete 
> number...
>
> *** "clickcharchunk" and "clickchunk" etc... are working the same way :-(
>
> Now i worked around this by setting the "textstyle" of those numbers 
> to "link" and
> [...]
> But this way other links do not look like links anymore, since these 
> properties are
> valid either globally or for a specific stack...
>
> Does anybody have another solution for this phenomenon?
> SHORT scripts preferred ;-)

You could do this by setting the textColor of the numbers to something 
subtly different from the remainder of the text (e.g. 1,1,1 instead of 
black), and the testing the color of the clickChunk ?   (Obviously, only 
if you aren't already using mixed colour text :-)

If you can't do that and need to script a solution, then it becomes a 
philosophical question - what's a number ?
(Assume the click is between the "1" and the "2" in the following examples)

12  ?    yes, value 12.
12.34 ?  yes, value 12 and a bit
-12.34 ?   yes probably, value negative 12 and a bit
+12.34 ?  yes probably
12.34; more text  ?   yes, value 12 and a bit with a semi-colon 
punctuation to follow
12.34. more text  ?  Maybe !  12 and a bit followed by a period ?  or 
maybe not.
12.34.56 ?   perhaps not, but perhaps yes
56.12.34 ?   probably not - would it be 56 and a bit or 12 and a bit ??
1234more text  ?  maybe
text1234more text ?  maybe

If you can give the right answer to some of these (either - "can't 
happen", or "don't care") then you can write a pretty short script to 
deal with it; if you can't ignore them, then the script may be rather 
longer.

-- Alex.


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 03/01/2005



More information about the use-livecode mailing list