Cells and tables

Malte Brill malte.brill at t-online.de
Wed Oct 22 05:32:25 EDT 2003


Hi,

I´ve been experimenting with this a bit and came up with the following:

In the field´s script:

on rawkeyDown
  send generateCells to me in 10 ticks
  pass rawkeyDown
end rawkeyDown
on generateCells
  put the customkeys of me into clearUp
  repeat with clearMe=the number of lines of clearUp down to 1
    if "cell" is in line clearMe of clearUp then
      delete line clearMe of clearUp
      set the customKeys of me to clearUp
    end if
  end repeat
  set the itemdel to tab
  put 0 into lLineCounter
  repeat for each line row in me
    add 1 to lLineCounter
    put 0 into lItemCounter
    repeat for each item colum in row
      add 1 to lItemCounter
      put "cell_"&lLineCounter&"."&lItemCounter into whichCell
      set the whichCell of me to item lItemCounter of row
    end repeat
  end repeat
end generateCells

Then you can refer to each cell like this:

put the cell_3.1 of fld "myField"

I like this. :-)

Regards,

Malte



More information about the use-livecode mailing list