This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-04-12 03:10:00

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Script variables block

Like in BYOB:
http://wiki.scratch.mit.edu/w/images/VariableBYOB.png

What it does is it creates new temporary variables for the script it is placed in. The variable shown on the block is NOT an input, but it is a variable that you can drag to pick up a copy of it just like blocks in the scripting area.

If it were in scratch, it will probably be called something more self explanatory like
"Use temporary variables {the variables} for this script only"

The arrowhead on the block adds another variable and once there is two or more, a left arrowhead to delete the most recently created variable.

You can click on the variable without dragging it to rename it, though scratch will probably change this to a rename option in the right click menu.

When a set block is placed in the same script as a script variables block, it's drop down menu will be updated to include the temporary variables.

If a variable is dragged into another script, it's value there will be 0.

Each script has its own script variables, even if two variables in different scripts share a name.

Recursive block definitions will receive a new set of variables on each recursive call of the block.

Last edited by joefarebrother (2013-04-12 03:10:18)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#2 2013-04-12 05:10:21

shadowmouse
New Scratcher
Registered: 2013-02-03
Posts: 100+

Re: Script variables block

Can anyone who is familiar with byob explain how I would go about making this in the scratch browser? I'm guessing that it's very complicated and requires a new image (left facing arrow) in the scratchskin.

Offline

 

Board footer