needing help with hyperlinks

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
hands16
Posts: 17
Joined: Sat Oct 19, 2013 2:23 am

needing help with hyperlinks

Post by hands16 » Sat Apr 05, 2014 1:00 am

ok so i have to know what line and what number a word is in a paragraph when making it a link, is there any way to figure out what number the word is without manually counting

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: needing help with hyperlinks

Post by Simon » Sat Apr 05, 2014 1:43 am

...what number a word is...
..what number the word is...
hmmm bit confused but
How about "wordOffset"?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm

Re: needing help with hyperlinks

Post by atout66 » Sat Apr 05, 2014 6:29 pm

And to forward Simon you could use that function to retrieve the line number:

Code: Select all

function retrieveLineNumber tTxt,tString
   get the number of lines in char 1 to offset(tString,tTxt) of tTxt
   return tTxt -- the line number
end retrieveLineNumber 
Credit for this script belong to Craig :wink:

Kind regards.
Discovering LiveCode Community 6.5.2.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: needing help with hyperlinks

Post by jacque » Mon Apr 07, 2014 12:00 am

atout66 wrote:And to forward Simon you could use that function to retrieve the line number:

Code: Select all

function retrieveLineNumber tTxt,tString
   get the number of lines in char 1 to offset(tString,tTxt) of tTxt
   return tTxt -- the line number
end retrieveLineNumber 
This is how we used to have to do it, but with LiveCode 5.5 came the new lineIndex and charIndex functions. Very handy.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply