Passing index in version 6.1

A program that worked for many months has stopped working under version 6.1 on the server. I have traced the problem to passing of an index in a for loop in a tell block. I now get the error that the index does not exist in this context, even though I attempt to pass it into the tell block explicitly. I have version 6.0 running locally on my computer (as a test environment); this behavior does not occur there. Browsers include Chrome, safari, Edge.
version bug

can you give us a link to the project?

How to get to the display that no longer works: Hit "Play" on upper right of blue splash screen (shown when green flag is clicked). Choose a couple of friends and a few cookies. Hit green "Play" button. The screen does not show the row of plates, friends, or cookies (as it should).

The procedure that contains the misbehaving code block is "Display Kids". There are two FOR loops in TELL blocks that show the error.

I presented this program in the Snap! conference yesterday. There was quite a scramble when we discovered a couple of hours before the session that it no longer worked. We had tested it under version 6.0 just the day before. :slight_smile:

The problem is that you're not using the input from the "with inputs"; one way to do that would be empty input slots instead of the internal plateindex variable slots, and the other way would be to use the arrowhead at the right edge of the gray ring to create a formal parameter.

ok, so I found your problem, remove the plateindex variable in the code like this


The empty input is automatically filled in with the plateindex variable.

By the way, in Snap! variable names can have spaces in them! "plate index"; "plate baseline"; etc.

Yeesh. That is a bit non-obvious! I had not used "with inputs" previously so was not aware that this was how it was done. Thank you!

A bit further on, I have code where I pass in an x and y value (in a Tell block) so I edited it for this change, and it works, BUT how does the interpreter know where to stick in the passed-in values if there are just blanks? Order dependence? What if I use the value multiple times? Just curious...

Yeah, Glen and I have religious wars over this issue frequently. :slight_smile:

it puts the first input in the first empty input slot, the second input in the second empty input slot, etc.

click on the arrow in the grey ring and you can use the variables to put the same input in different spots, for example,

tells sprite(2) to go to x: 10 y: 50, and for the same value multiple times, this on tells sprite(2) to go to x: 50 x: 50. Note: when you can see the input names variables, the empty inputs are empty inputs, the don't get filled in.

Hi, Gina, that's a bug I introduced yesterday and just now fixed. Can you try your project again right now? It should work again. Sorry!

I still need to use the "with inputs"; an earlier version still would not work. But I am chasing down these little annoyances to get a corrected version on the server.

I've got a version now that runs on the server (Snap! 6.1 compliant!), but I have a housekeeping problem. I can save the program in the Cloud as just "Cookies". Fine. Then I deleted the old Cloud copy named "Kids and Cookies" and a few other abortive versions. Then I attempted to save my working version as "Kids and Cookies" but got this complaint:


I think I confused the Cloud! :slight_smile: :slight_smile:

https://snap.berkeley.edu/snap/help/SnapManual.pdf Page 50

@bromagosa

Yep, this is in my ToDo list and has been reported before here in the forums. We're keeping deleted projects for recovery purposes, and that causes a bug when you try to save a project with the same name as a previously deleted one.

I'll work on this post Snap!Con :slight_smile: