Execution Error

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
Bantymom
Posts: 73
Joined: Fri Aug 27, 2010 4:32 am

Execution Error

Post by Bantymom » Tue Oct 26, 2010 12:26 am

I was trying to slim down my stack, and as I had moved a group of objects over to another card, I deleted the original card. Yes, this was a mistake, because of course, I had forgotten I had things going to that card.

But, not to worry, I went to the blip in the script and rewrote the line to direct it to the same field on the new card.

Or so I thought. Now I get an execution error, and I can't figure out what the problem is:
stack " Spelling Game Tomas IV": execution error at line 39 (Chunk: no such object) near "List 2", char 4
Here are the pertinent lines of code, with both the old and new versions of line 39 at the bottom:

Code: Select all

   put "List" && the cLevel of this stack into tList
   answer tList --just put this in to check to see if tList was the problem, and tList is showing up correctly in the message box
   put empty into field "Temporary List" of group "Students" of card "Teacher Card" --no problems here, though it references the same location
   put field tList of card "List Card" into field "Temporary List" of group "Students" of card "Teacher Card"
   --put field tList of card "List Card" into field "Temporary List" of card "Teacher Card"
The card "Teacher Card" is the card I deleted. I had moved all of the objects over to another card and put them in a group which I named "Students". I then renamed the new card "Teacher Card" to maintain the continuity. I did nothing to card "List Card", but I did check all the fields there to be sure that they were still named correctly. I checked the names of all the objects referenced in line 39 to be sure they were all correct and with no spelling errors or that no extra spaces had crept in. Before I moved the objects and deleted the original card "Teacher Card", everything worked smoothly. The only difference between previous set up is that field "Temporary List" is now part of a group, which it wasn't before.

So, what am I missing? I'm sure it is something simple, I've missed silly things before. I just need a second pair of eyes to look because at this point, the harder I look at everything, the more I think I am not seeing!

I have included the new card "Teacher Card". It isn't finished, and most of the fields and buttons don't do anything yet, but the field "Temporary List" is there. Perhaps I have a property set wrong? (I know a custom property would better serve for storing the temporary copy of the word list, but I want the teacher to be able to see it, so I have decided to leave it in a field.)

tied up in knots,
Bantymom
Attachments
Teacher Card.rev.zip
(22.01 KiB) Downloaded 262 times
2nd-grade Teacher, Poultry Fancier, Scottish Country Dancer
and Perpetual Beginner

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Execution Error

Post by bn » Tue Oct 26, 2010 1:02 am

Bantymom,

there is a return in the custom property cLevel of the stack. Go to the property inspector and click behind the 2 and go with the arrowkey into the second line. Delete the return and you are fine. Or just select all in the custom property and type a 2 in there.
Because of the return the variable tList had a return in it and that did not resolve to the right card.
If you put the 2 there by script then you would have to look at the script, if you typed it in then this sort of things happens all too often. (speaking from experience)

regards
Bernd

Bantymom
Posts: 73
Joined: Fri Aug 27, 2010 4:32 am

Re: Execution Error

Post by Bantymom » Tue Oct 26, 2010 3:02 am

Aaaaaaaaaah!

Thank you! That was indeed the problem. I had manually changed the number back to 2 because every time I run through the game to check out my newest additions, it increases the level. I will make a button to do that now, and will be aware of the possibility of that same error in the future.

You are my hero.

Bantymom

*begins to reinsert pulled-out hair into her head*
2nd-grade Teacher, Poultry Fancier, Scottish Country Dancer
and Perpetual Beginner

Post Reply