Detecting which column was clicked in a Table field

Mark Stuart mstuart at
Wed May 26 18:43:51 EDT 2010

on 5/26/2010, Jacqueline wrote:
Something like this:
  put word 4 of the clickchunk into tCharNum
  subtract (the number of chars in line 1 to \
     (word 2 of the clickline)-1 of me) +1 from tCharNum
  set the itemdel to tab
  put the number of items in char 1 to tCharNum of the value of the

I tried your script and it worked as is, but not as planned.
When clicking in the white space of a column, it returns the number 4.
When clicking on the text of a column, a number is returned.
But when clicking in the far left column, it returns 0 (zero).

So I changed the clickChunk to mouseCharChunk and that worked better. It
returned a value when clicking in the white space 'inside' the values in
the row. Clicking to the far left or far right of the row value text
returns nothing.

I did notice that So Smart Software has a tutorial on Table fields,
which shows how to get the row number and column number from the field
custom props. But the table field's lockText property has to be false,
allowing editing. Having it set to true does not return a value :(

So far I haven't found a bullet proof solution, but will continue to
work on it and let you know.

Anybody else got ideas on this?

Mark Stuart

More information about the Use-livecode mailing list