easy way to do itemoffset and lineoffset simultaneous
Mark Brownell
gizmotron at earthlink.net
Sat Aug 16 17:21:00 EDT 2003
On Saturday, August 16, 2003, at 02:14 PM, Mark Brownell wrote:
>
> 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
Follow up:
Try:
put "(3,18)" into myXY
put wordOffset(myXY, myDataString) into zap
put word (zap + 1) of myDataString into coordinateZap
so you would use a space as the delimiter for a string of data. You
could even drop the parentheses using records like "3,18
0,0,0,0,0,0,1,0,1," that exist as two words for each grid coordinate.
example: put "3,18" into myXY
More information about the use-livecode
mailing list