detecting cell movement in a table

Richard Gaskin ambassador at
Sat Jun 27 19:59:40 EDT 2015

Dr. Hawkins wrote:

 > I have handlers in the group that sometimes trigger on the
 > revUpDateCellValue, but none of the other handles ever trigger.
 > I have handlers like
 > on revWhatever a,b,c,d
 > ck a & cr & b & cr & c & cr & d
 > breakpoint
 > pass revWhatever
 > end revWhatever
 > none of these trigger as I move about and edit.  I put them in both
 > the table script and the group script.
 > sometimes revCellUpdate is called when a cell changes, and other
 > times not.

I'd guess the revTableLibrary is a frontScript, since it needs to be 
able to respond to messages the user may otherwise override, and it 
predates the invention of behaviors with their "before" message handling 

And since its custom handlers are needed only by itself, I'll bet it's 
not passing them.

Reading the handlers in revTableLibrary it seems to make extensive use 
of two custom properties to determine the current X and Y cell location:


So you can modify this setProp handler to respond to changes to either 
of those:

setProp cRevTable[pProp] pVal
    if pProp is "currentXcell" then
       put pVal, the cRevTable["currentYcell"] of me
    else if pProp is "currentYcell" then
       put the cRevTable["currentXcell"] of me, pVal
    end if
    pass cRevTable
end cRevTable

PS: since you seem to spend a lot of time in the debugger to discover 
the calling chain of handlers, you may find having those presented in a 
list for you in real-time much easier and faster - this free tool does 
that and more:


If nothing else it's a useful example of the messageMessages global 
property in action.

  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  Ambassador at      

More information about the Use-livecode mailing list