
- Your solution is clever , and
- it appears to supply a work around to the issue, and
- your thinking is valid (it is weird to me also, but I lack enough knowledge to know exactly why, so weird more in a "curiosity" way).

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I think so too. Something "sticks" in the innards of a table field when a "cell" has had something put into it. The craziness occurs upon exiting the "phantom" field LC creates to simulate text entry in a "cell". The team should be able to isolate the problem readily.I kind of doubt that it is random, I’m guessing there will be a pattern too.
reported dec 2016.I did find this bug report https://quality.livecode.com/show_bug.cgi?id=18983, but aint sure if it is the same thing or not.
Code: Select all
on revWriteCellField pObject
--revSetScrollInfo pObject
put the cREVTable["currentxcell"] of pObject into txcell
put the cREVTable["currentycell"] of pObject into tycell
put the cREVTable["currentview"] of pObject into tCurrentView
put revGetCellName(pObject) into tFieldName
if there is not a field tFieldName then exit revWriteCellField
put the long ID of field tFieldName into tFieldRef
put the text of field tFieldName into tNewText
put the htmltext of field tFieldName into tNewHtmlText
-- now that we have what we need, abuse the temp field a bit *chuckle*
lock screen
lock messages
-- if the currentview is not yet in htmlText, make sure to convert it
if isHTML(tCurrentView)
then set the htmltext of field tFieldName to tCurrentView
else set the text of field tFieldName to tCurrentView
set the itemDelimiter to tab
# Patch for bug 18983
if the number of items of line tycell of field tFieldName < txcell then
put empty into item txcell of line tycell of field tFieldName
end if
# end patch
put the htmltext of item txcell of line tycell of field tFieldName into tCurrentHtmlText
if tCurrentHtmltext contains "#9;" then
put "<p></p>" into tCurrentHtmlText
end if
## NOTE :: DO NOT REMOVE THE LOCK MESSAGES OR YOU'LL GET AN ERROR AFTER SETTING THE HTMLTEXT !!!
if not (tNewHtmlText = tCurrentHtmlText) then
set the htmltext of item txcell of line tycell of tFieldRef to tNewHtmlText
set the cREVTable["currentview"] of pObject to the htmlText of tFieldRef
try -- this has to be try because there may not be a database library in a standalone
send "revUpdateDatabase pObject,txcell,tycell,tNewText" to pObject
catch tError
end try
end if
-- and unlock things again
unlock messages
unlock screen
-- move on with the other updates
revUpdateScrollInfo pObject
revDisplayFormattedData pObject
if exists(pObject) then
send "revUpdateCellValue pObject,txcell,tycell,tcurrentcell,tNewText" to pObject
end if
end revWriteCellField
Some day I will do a post without goofing it up, promised....The only difference, is the stack with the "revWriteCellField" is actually named "revTableLibrary"
Code: Select all
on mouseUp
set the itemDel to tab
repeat with x = 1 to 200
repeat with u = 1 to 200
put "" into item u of line x of temp
end repeat
end repeat
put temp into fld "yourTableField"
end mouseUp