Detecting which column was clicked in a Table field

J. Landman Gay jacque at
Wed May 26 18:53:43 EDT 2010

Mark Stuart wrote:
> 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
> clickLine
> <<
> Hi,
> 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).

That's technically correct because there aren't any items before the 
text starts. You could put in a single exception for that special case: 
if tNumber < 1 then put 1 into tNumber.

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the Use-livecode mailing list