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

#1 2009-09-06 07:15:40

Implode
Scratcher
Registered: 2009-09-04
Posts: 20

Store input

If I prompted the user for their name, how do I assign it to a variable and store it.

Offline

 

#2 2009-09-06 08:38:33

floatingmagictree
Scratcher
Registered: 2008-10-21
Posts: 1000+

Re: Store input

Do this:

When Green Flag Clicked
<Ask [ what's your name ] and wait>
<Set [Whatever your variable is.] to (answer)>

Or if you want to add it to a list:
<add ( answer ) to list>

Last edited by floatingmagictree (2009-09-06 11:48:39)

Offline

 

#3 2009-09-08 02:21:24

Implode
Scratcher
Registered: 2009-09-04
Posts: 20

Re: Store input

Thanks.

If I wanted to store high score. I could make a variable highscore and another called score.

If score > high score
   set highscore = score ;

but how would I keep the name I stored to stick to the score they made?

Offline

 

Board footer