Exiting script after going to card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Exiting script after going to card

Post by jalz » Sat Apr 22, 2017 4:17 pm

Hi Guys,

I have an unusual issue here. I've got the following code, and it seems to exit after it hits the go to card tCardName of stack "Print" line. Can anyone shed any light why the function would stop exiting if it went to a card. I've put in breakpoints and walked through, it doesn't seem like its executing any script when it opens the card and the current script I am in seems to exit after the card appears on the screen.

Any advice would be much appreciated
Thanks
Jalz

Code: Select all

  ------------<Start building the pages>--------------
   put the visible of group tPrintObjectLine of card "Stationary" of stack "Stationary" into tVisible
   set the visible of group tPrintObjectLine of card "Stationary" of stack "Stationary" to true
   copy group tPrintObjectLine of card "Stationary" of stack "Stationary"
   set the visible of group tPrintObjectLine of card "Stationary" of stack "Stationary" to tVisible
   
   put "Print " & tPageNo into tCardName
   
   lock screen
   go to card tCardName of stack "Print"
      
   put the number of elements of tGrid into tGridCount

   repeat with tIndex = 1 to tGridCount
      
   ...... more code

   end repeat
Last edited by jalz on Sun Apr 23, 2017 11:09 am, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Exiting script after going to card

Post by FourthWorld » Sat Apr 22, 2017 11:46 pm

Try adding "lock messages" in a new line immediately following "lock screen". If that fixes the problem then you probably have one of the "open" messages ("preOpenCard", preOpenBackground", "openCard", etc.) being triggered in a shared group, a card, the stack, or (if the Print stack is a substack) the mainstack of the stackffile.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: Exiting script after going to card

Post by jalz » Mon Apr 24, 2017 8:27 pm

Thanks Richard

That seemed to worked. I cant seem to find the open messages that may be causing this but I presume the lock messages command can be used permanently to rectify the open messages being triggered.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Exiting script after going to card

Post by FourthWorld » Mon Apr 24, 2017 8:51 pm

4W Flight Recorder to the rescue!

I wrote a utility that will log messages and triggered handlers in an indented list to make it easy to track such things down.

You can get 4W Flight Recorder in the Stack Files section of LiveNet, a plugin pre-installed with LiveCode (in the LC menu bar see Development -> Plugins -> GoLiveNet ).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply