getting the word and line chunk of words simultaneously

James Hale james at thehales.id.au
Thu Dec 11 01:40:09 EST 2008


Hi,

I am trying to process a body of text in order to populate a database  
with word positions within the text.

However I do not just want the word position within the text itself.

I also want the line the word is located and the position within that  
line.

So, as an example I end up with the following for one word, say  
"football"

Word:  football
Text position: 132
Line:	4
Line Position: 13

Looking over the docs I could do this by placing the text into a field  
and select each word in turn and then use the selectedLine function to  
determine the line and the selected chunk to get the start and end  
characters but this is not enough. Besides, these functions require  
actually selecting the text in the field which I gather would slow  
things down considerably.

Has anyone on the list needed to do something like this before?

If so, any pointers?


James Hale

james at thehales.id.au

Tel: +61 3 9386 2516
Fax: +61 3 9386 1387






More information about the use-livecode mailing list