converting Offsets into Line Numbers

Andre Garzia soapdog at mac.com
Sun Jun 5 15:30:03 EDT 2005


On Jun 5, 2005, at 4:24 PM, Jon wrote:

> 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?
>
> :)
>
> Jon
>

Jon,

quick and dirty, imagine the following listing

blue
yellow
red
green
laranja

put lineoffset(tList, "red") into tLocation
put line tLocation of tList

this will put the line that contains red in the tLocation variable and 
after will put the given line in the message box

Cheers
andre





> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-- 
Andre Alves Garzia ð 2004
Soap Dog Studios - BRAZIL
http://studio.soapdog.org



More information about the use-livecode mailing list