How to get the line number from a char position ?
Posted: Sat Mar 22, 2014 5:48 pm
Hi to all,
After some search, I still don't find the answer of this problem... I use the following code :
where the <theString> is some chars like "to test this code" in a text var called <theTxt> with severall lines (many).
The offset() returns me the first char position of <theString> in <theTxt>. OK.
Problem: I don't see from there, how I can get the line number in which belongs <theString> ?
I would like to avoid a <repeat> loop inside each line of <theTxt> if possible (they are many), that's why I try whith offset()...
Any idea how to proceed maybe ?
Thanks in advance.
After some search, I still don't find the answer of this problem... I use the following code :
Code: Select all
get offset(theString,theTxt)
The offset() returns me the first char position of <theString> in <theTxt>. OK.
Problem: I don't see from there, how I can get the line number in which belongs <theString> ?
I would like to avoid a <repeat> loop inside each line of <theTxt> if possible (they are many), that's why I try whith offset()...
Any idea how to proceed maybe ?
Thanks in advance.