Great Tip from Ken Ray about lineOffset

Brian Yennie briany at qldlearning.com
Fri Mar 25 06:00:36 EST 2005


> I guess I don't understand the code, or something.
>
> If the item I am searching for is the very first item, then the 
> itemOffset() returns 1, so the div produces 0 which goes into 
> tLineNumber.  Therefore the if test is false, so I don't add the 1 - 
> leaving me with a value of 0.
>
> I'd interpret that to mean "item not present", since there isn't a 
> line number 0.
>
> Am I  missing something obvious ?

Nope, just my email typing carelessness.

replace (the lineDelimiter) with (the itemDelimiter) in tList
put itemOffset(tItem, tList) into tLineNumber
if (tLineNumber > 1) then put (tLineNumber div itemsPerLine + 1) into 
tLineNumber

That should be a little better...

- Brian



More information about the use-livecode mailing list