clicktext and decimal numbers

Klaus Major klaus at major-k.de
Thu Jan 6 08:09:20 EST 2005


Hi Scott,

> Recently, Klaus Major wrote:
>> 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
>> :-(
>> ...
>> SHORT scripts preferred ;-)

Ahem... ;-)

> Maybe this could work:
>
> function getTheText tField
>   put fld tField into F
>   put the clickChunk into T
>   put value(T) into N
>   if N is a number or N = "." then
>     put (word 4 of T) + 1 into C
>     repeat while (char C of F is a number or char C of F = ".")
>       put char C of F after N
>       add 1 to C
>     end repeat
>     put (word 2 of T) - 1 into C
>     repeat while (char C of F is a number or char C of F = ".")
>       put char C of F before N
>       add -1 to C
>     end repeat
>     return N
>   else return the clickText
> end getTheText
>
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, Development & Design

Yes, great, thanks, exactly what i was looking for!
...and was just too lazy to write it on my own :-D


Best from germany

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list