TOC hyperlinks to same field text below

J. Landman Gay jacque at hyperactivesw.com
Sun Mar 26 13:23:01 EST 2006


Sivakatirswami wrote:
> Fascinating solution. Is there a way to get the field to set the  scroll 
> such that the found line is the top line of the field?

Yes, watch for wrap:

on linkclicked pLinkText
   find string pLinkText & numToChar(8)
   set the scroll of me to (the formattedheight of line 1 to (word 2 of 
the foundline) of me) - the effective textheight of me
   find empty -- removes the box
end linkclicked

Interestingly, subtracting 1 from the foundline and getting the 
formattedheight of that number of lines doesn't give the same result as 
the above. Not sure why, because it should.


> 
> Sivakatirswami
> 
> 
> On Mar 25, 2006, at 6:00 PM, J. Landman Gay wrote:
> 
>> I use a trick. Use a script to put a non-typeable character, like  
>> numToChar(3) or numToChar(8), after the text you need to find. I do  
>> this with a temporary handler in the field:
>>
>> on selectionchanged
>>   put numtochar(8) after the selection
>> end selectionchanged
>>
>> Then I just click my way through the body of the text, adding  
>> invisible characters as I go.
>>
>> Change the "find" command in the linkClicked handler so that it  adds 
>> that character to the string to find, and use "find string":
>>
>> on linkclicked pLinkText
>>  find string pLinkText & numToChar(8)
>> end linkclicked
> 
> 
> 
> 
> 


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list