needing help with hyperlinks
Posted: 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
Questions and answers about the LiveCode platform.
https://www.forums.livecode.com/
...what number a word is...
hmmm bit confused but..what number the word is...
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.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