Problem with "delete button"

pink nabble at mad.pink
Mon Dec 19 13:38:35 CET 2016


In a nutshell: I have a stack that I've been tinkering with for while. There
is a particular handler in which there is a "delete button" command which
causes Livecode to crash in 8.1 thru 8.1.3 (I don't have any versions of
Livecode prior to 8.1 right now). Everything works fine in 7.1.4 and 6.7, so
it is a new problem.

This happens in the IDE and in standalones built. Oddly, there's no crash
log, so I guess I would describe it more as "suddenly quits".

If you're familiar with 2048, it is a similar game system. Numbered buttons
get moved around a board, and when two alike numbers collide, they get added
together and one of the buttons gets removed. Below is the actual handler,
the problem line is "delete button tAtom"

command fuseAtoms pStarting,pDestiny, at pGame
     put pGame["hex"][pDestiny]["atom"] into tDAtom
     put pGame["hex"][pDestiny]["value"] into tDValue
     
     put tDValue*2 into pGame["hex"][pDestiny]["value"] 
     
     if pGame["keeper"]["best"]<pGame["hex"][pDestiny]["value"]  then put
pGame["hex"][pDestiny]["value"]  into pGame["keeper"]["best"]
     
     set the label of the button tDAtom to pGame["hex"][pDestiny]["value"]
     
     put pGame["hex"][pStarting]["atom"] into tAtom 
     delete button tAtom
     put empty into pGame["hex"][pStarting]["atom"] 
     put 0 into pGame["hex"][pStarting]["value"] 
     put empty into pGame["hex"][pStarting]["fused"] 
     put empty into pGame["hex"][pStarting]["flavor"] 
     put empty into pGame["hex"][pStarting]["new"] 
     add tDvalue*2 to pGame["keeper"]["score"] 
     put 1 into pGame["hex"][pDestiny]["fused"] 
     put 1 into pGame["keeper"]["validMove"]
     set the backgroundColor of graphic pStarting to empty
     if pGame["hex"][pDestiny]["flavor"] is 2 then set the backgroundColor
of graphic pDestiny to pGame["settings"]["twoBack"]
     if pGame["hex"][pDestiny]["flavor"] is 3 then set the backgroundColor
of graphic pDestiny to pGame["settings"]["threeBack"]
     if pGame["hex"][pDestiny]["flavor"] is 5 then set the backgroundColor
of graphic pDestiny to pGame["settings"]["fiveBack"]
     if pGame["hex"][pDestiny]["value"] is 0 then 
          set the backgroundColor of graphic pDestiny to
pGame["settings"]["gunkBack"]
          add 1 to field "gunkCountShow"
          add 1 to pGame["keeper"]["negativeCount"]
     end if
     if pGame["hex"][pDestiny]["value"] is 0 then set the textColor of
button tDAtom to pGame["settings"]["gunkText"]
     
     put 1 into pGame["keeper"]["validMove"]
end fuseAtoms




--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Problem-with-delete-button-tp4711069p4711075.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list