converting Offsets into Line Numbers

Ken Ray kray at sonsothunder.com
Sun Jun 5 15:38:51 EDT 2005


> If I have a string with lots of lines in it (like a folder/file listing)
> and search for a file name with Offset and get a number back, now do I
> convert it into a line number, so I know which file name I found?

Well, first of all might I suggest "lineOffset", which is the same as
offset, but returns the number of line where it is found. However if you
don't want to do that, you could as for 'the number of lines of char 1 to
<offsetNum> of <container>'.


Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list