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

#1 2010-09-16 19:17:18

bebyb
New Scratcher
Registered: 2010-09-12
Posts: 18

Variable?

What are variables and how do you make and use them?

Offline

 

#2 2010-09-16 19:20:55

laser100
Scratcher
Registered: 2009-12-04
Posts: 100+

Offline

 

#3 2010-09-16 19:23:30

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: Variable?

If you want to make a variable:
1. Go to the orange "Variables" tab
2. Click on "Make a variable"
3. Input the name
4. Choose Local or Global scope

Variables are things that can take a given value. The best analogy I have heard is this:
Variables are like mailboxes. What I mean by this is that you put a value into the variable and then when you reference the variable you "look inside the mailbox" and use the given value. At any time while the project is running you can use the "Set [] to ()" to change the value inside the mailbox.

They can be used for lots of different things. For example you can use them to make Score in a game:
http://img20.imageshack.us/img20/5633/variable.gif


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

Board footer