row and column of table clicked on

Sarah Reichelt sarah.reichelt at
Thu Nov 16 20:25:50 EST 2006

On 11/17/06, John Craig <jc at> wrote:
> Can you tell which row and column the user clicks on a table field?  I
> have used the clickChunk, but you must click on the text - the
> whitespace around it returns empty.

Here is the script I use for getting the column number:

    put item 1 of the clickloc into tClick
    put the left of me + the margins of me - the hscroll of me into tL
    put the tabstops of me into tStop
    put tClick - tL into tClick
    put (tClick div tStop) + 1 into tItem

It relies on having a single tabStop set i.e. "100" not "100,200,300,400"...
Since this was fine for me, I haven't bothered to improve it.

I have never tried to work out the line but the same sort of script
could be used, I'm sure.

Hopefully this is enough to get you started.


More information about the Use-livecode mailing list