clicktext and decimal numbers

Scott Rossi scott at tactilemedia.com
Thu Jan 6 07:37:18 EST 2005


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
> :-(
> 
> Now i worked around this by setting the "textstyle" of those numbers to
> "link" and
> 
> set the underlinelinks to false
> set the linkcolor to 0,0,0
> set the linkvisitedcolor to 0,0,0
> set the linkhilitecolor to 0,0,0
> 
> to make the numbers look like any other text.
> Now "the clicktext" returns "12.34", which is what i want.
> 
> 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 ;-)

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
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the use-livecode mailing list