- This zho is about the block. For more information on the value this block reports, see Answer (value).
This block can be displayed as a 舞台監控視窗.
As this block stores imputed text, it is very useful where a 程式 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 block could be used.
Some common uses for the Answer block:
- Storing information (such as in 專案 that require a name to be inputted)
詢問 [What's your name?] 並等待 變數 [name v] 設為 (詢問的答案) 說出 (字串組合 (字串組合 [Hi, ] 和 (詢問的答案)) 和 [!])
- Retrieving information (such as when the name must be retrieved)
詢問 [What's your favorite color?] 並等待 說出 (字串組合 (詢問的答案) 和 [ is my favorite color too!])
- When a setting has been imputed with the 詢問 () 並等待 block, keeping the selecting setting somewhere
詢問 [Which level do you want to play?] 並等待 變數 [level v] 設為 (詢問的答案) 廣播訊息 (字串組合 [start level] 和 (level)) // This can actually be done in the Scratch editor. You can not, however, place reporters in "when I receive"
- When quizzing
詢問 [What is 30 + 9?] 並等待 如果 <(詢問的答案) = > 那麼 說出 [That is correct!] 變數 [Score v] 改變 (1) 說出 [That is incorrect] 變數 [Score v] 改變 (-1) end