From Test-Scratch-Wiki

Revision as of 07:29, 23 December 2017 by Mass editor (talk | contribs) (Automated edit: Updated Test Wiki copy of English Wiki page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Translate: - English 
The dialog the question is asked in.
The Answer is a value that is the latest input into the Ask () and Wait block.

It was introduced in Scratch 1.4.

Related Blocks

The following blocks can be used in conjunction with this value:

  • 2.0 Answer.png

— The stage monitor and reporter block that reports the value of the answer

  • 2.0 Ask () and Wait.png

— Sets the value to something which the user inputs

Resetting the Answer

Offline, the answer can be reset (made blank) by pressing either the green flag or stop sign.
Online, there is no way to reset the answer variable itself without using another variable and pretending that variable is the answer block.

Example Uses

As this value stores inputted text, it is very useful where a script has to refer to what has been inputted. For example, there are chatbots that let the Scratcher input their name — if the script needed to see the name, the Answer value could be used.

Some common uses for the Answer value:

  • Storing information (such as in projects that require a name to be inputted)
  • Recalling information (such as when the name must be retrieved)
  • When a setting has been inputted with the Ask () and Wait block, keeping the selecting setting somewhere