easy way to do itemoffset and lineoffset simultaneous

Mark Brownell gizmotron at earthlink.net
Sat Aug 16 16:18:00 EDT 2003


Saturday, Björnke von Gierke wrote:

> 3,18,0,0,0,0,0,0,1,0,1
> 3,19,1,0,0,0,0,0,0,0,0
> 3,20,1,0,0,0,0,0,0,0,0
> 4,1,1,0,0,0,0,0,0,0,0
> 4,2,0,0,0,0,0,0,1,0,1
> 4,3,1,0,0,0,0,0,0,0,0
> ...
>
> I know about the line which begins with 3,18 and now I need to get all 
> lines which are nearby (x/y grid).  That means I need to get the  
> lines which begin with: 2,17 2,18 2,19 3,17 3,19 4,14 4,18 4,19
> I don't know how to get these lines with that information because I 
> can't do itemoffset (I need lines) and I cant do lineoffset (I got 
> items).
> If there just where a command like : lineoffset(item 1 to 2 of the 
> line to find,container to search) :-(

If I were going to do this I would not use lines as a delimiter if that 
is possible. I'd store information as (3,18) 0,0,0,0,0,0,1,0,1, (3,19) 
1,0,0,0,0,0,0,0,0,  (3,20) 1,0,0,0,0,0,0,0,0, (4,1) 1,0,0,0,0,0,0,0,0 
(4,2) 0,0,0,0,0,0,1,0,1 (4,3) 1,0,0,0,0,0,0,0,0 where "(" is the 
delimiter. I'm no expert at this but you could use offset(), regEx, or 
split to extract your needed grid coordinates from a single delimited 
string. This way x/y grid numerical values in parentheses would not 
conflict with equivalent numerical values in the rest of each delimited 
data if they were to occur.

Mark




More information about the use-livecode mailing list