Linked text in a field as a form

Bill Vlahos bvlahos at mac.com
Sun Nov 12 17:11:21 EST 2006


The long id of the target just points to the filed itself not to 
anything specific inside the field (i.e. field id 1004 of card id 1002 
of stack "Untitled 1"). What I need is the char 23 to char 30 of the 
field.

ChickChar only gives me the char number clicked on but the the entire 
linked phrase. Is there a way to get the start and end chars of a 
linked textStyle?

Bill Vlahos

On Nov 11, 2006, at 3:09 PM, Ken Ray wrote:

> On 11/11/06 4:37 PM, "Bill Vlahos" <bvlahos at mac.com> wrote:
>
>> The following handler in the locked field will give me the grouped 
>> text
>> itself:
>> on linkClicked theText
>>    put theText
>> end linkClicked
>>
>> ...but it won't tell me
>> 1. Which group it was in the field (can I identify multiple linked
>> texts in a field)?
>> 2. How do I replace the original text group? (I.e. put varText into
>> group 2 of field "form")
>> 3. How do I keep the replaced text also as a group?
>
> You should be able to use "the target"... here's how this would work:
>
> on linkClicked pText
>   put the long id of the target into tTarget
>   ask "Replacement:"
>   if it <> "" then
>     do "put it into" && tTarget
>     set the textStyle of char 1 to \
>        length(the text of tTarget) of tTarget to link
>   end if
> end linkClicked
>
> Have fun!
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list