A third alternative: split off the chapter title list into another field -- a list field -- and then you can just do a simple find in your text field when the user clicks in the chapter list field.
-- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Wed, Feb 3, 2016 at 8:39 AM, Tiemo Hollmann TB <toolb...@kestner.de> wrote: > Alternativly I also tried to work with lineOffset and setting the vScoll of > the field. The lineOffset gives me the number of the found textline, but > not > the visible line number of a scrolling field with word wrap, which can be > resized. In such a field the "effective" line number can vary, depending on > the current size of the field. > Is there anything such as the "effective lineOffset", or even better a > direct approach to scroll to the found chunck? Probably I don't see the > obvious. > Tiemo > > -----Ursprüngliche Nachricht----- > Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im > Auftrag > von Tiemo Hollmann TB > Gesendet: Mittwoch, 3. Februar 2016 12:07 > An: LiveCode User Liste senden <use-livecode@lists.runrev.com> > Betreff: How to create a hyperlink within a text field? > > Hello, > > just not to invent the wheel again. I have a long text field with a table > of > contents at the beginning and headlines for chapters and I would like to > make the table of content clickable as hyperlinks, so that the user is > forwarded to the wanted chapter in the same field. > > I can set the textstyle of each chapter in the table of content to "link" > and handle the click in "on linkClicked pLink", no problem about that. > > The question is, how to handle the field scrolling to the wanted chapter > headline after clicking on the hyperlink. When using "find whole pLink in > the target", the find command finds first the chapter headline in the table > of content and stops at the top. I could cheat this, by doubleing the find > command, so that the second find command goes on searching and finds the > real chapter headline and scrolls the field to the wanted chapter. > > But I think that there must be a more straight forward way to realize this > kind of hyperlink. > > Thanks > > Tiemo > > > > > > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your > subscription preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode > _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode