lineoffset and itemoffset alltogether

Richard Gaskin ambassador at fourthworld.com
Thu Dec 11 16:22:53 EST 2003


Rob Cozens wrote:

>> I tried to find a workaround. I actually have a variable
>> that contains a large number of lines, and each line
>> contains the same number of items. I thought I could
>> use itemoffset straight (instead of lineoffset) and then
>> compute the # of the line with a simple calculation.
>> But things aren't so simple... Here's what I mean :
>> 
>> let's say with have a fld with 2 lines, each line containing
>> 5 items :
>> a,b,c,d,e
>> f,g,h,i,j
>> 
>> if you type "select item 5 of line 1 of fld 1" in the msg box,
>> "e" will be selected.
>> "select item 1 of line 2 of fld 1" will select "f".
>> But if you type "select item 5 of fld 1" then "e" and return
>> and "f" will be selected.
> 
> JB:
> 
> If your design can accommodate an extra empty item at the end of each line:
> 
> a,b,c,d,e,
> f,g,h,i,j,
> 
> I think it would work...even for item = <return>f.
> -- 

If you're doing lots of access into the data set in any non-looping manner,
you'll find a tremendous speed boost (more than an order of magnitude in my
tests here) by putting your lines into array elements.

-- 
 Richard Gaskin 
 Fourth World Media Corporation
 ___________________________________________________________
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc



More information about the use-livecode mailing list