Linked text in a field as a form

Ken Ray kray at sonsothunder.com
Sun Nov 12 20:00:48 EST 2006


On 11/12/06 4:24 PM, "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
wrote:

> Hi Bill,
> 
> on linkclicked
>      put the clickchunk
> end linkclicked
> 
> Will return something like char 15 to 30 of field 1: first char to
> end char of the linked clicked text in field 1.


Here you go Bill:

on linkClicked pText
  put the clickChunk into tChunk
  put the long id of the target into tTarget
  ask "Replacement:"
  if it <> "" then
    do "put it into" && tChunk
    put word 2 of tChunk into tStart
    put word 4 of tChunk into tEnd
    set the textStyle of char tStart to \
      (tStart + length(it) - 1) of tTarget to link
  end if
end linkClicked

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list