(Redirected from Reporter)
- This article is about the type of block. For the feature on the Scratch Website, see Report.
A reporter block is a block that reports a value. These can be anything, from numbers to strings. Unlike a stack block, which changes something on the stage, plays a sound, stops the script, or changes a variable, reporter blocks cannot be placed directly above or below another block. Instead, they are dropped into a number, text, or drop-down input; then when Scratch runs the block into which the reporter block has been dropped, it will first run the reporter block to find the value of the input. Reporter blocks can have inputs too, which may themselves be other reporter blocks. Boolean Blocks are a special kind of reporter block that reports either "true" or "false".
To quickly view the value of a reporter, simply click it in the editor and Scratch will display the value in a small bubble.
Shape
This is an example of a Reporter Block:
(x position)
As reporter blocks report values, they are designed to fit wherever a value is needed. This can be anywhere: many blocks have spaces (parameters) within them or drop-down menus capable of inputting reporter blocks. For example:
glide () secs to x: () y: ()
This block can easily be filled with Reporter blocks:
glide (costume [number v]) secs to x: (y position) y: (x position)
Use
As reporter blocks report values, they are used whenever a script needs a certain value. These values can be anything — from X positions to the costume number of a sprite. Reporter blocks also need another block to work; they cannot stack like stack blocks.
For example, compare these two scripts:
when gf clicked say [Hello,] for (1) seconds:: looks say [Gobo!] for (1) seconds:: looks when gf clicked say [Hello,] for (1) seconds:: looks say (username) for (1) seconds:: looks
In the first script, the message is predetermined. In the second script, a reporter block has been dropped into the first input of say [] for () seconds:: looks
, and so the message depends on the value of username
.
Because reporter blocks have inputs which may themselves be reporter blocks, join [][]
can be used to show the same message, but all at one time:
when gf clicked say (join [Hello, ] [Gobo!]) for (2) seconds when gf clicked say (join [Hello, ] (username)) for (2) seconds
Blocks
There are 34 normal reporter blocks in Scratch 3.0 and 15 extension blocks, for a total of 49.
Note: | Click on a block for more information. |
Motion
Looks
Sound
Sensing
distance to ( v)
answer
mouse x
mouse y
loudness
timer
[ v] of ( v)::sensing
current [ v]
days since 2000
username
Operators
() + ()
() - ()
() * ()
() / ()
pick random () to ()
join [] []
letter [] of []
length of []::operators
() mod ()
round ()
[ v] of ()::operators
Variables
Music
Video Sensing
Translate
micro:bit
LEGO BOOST
LEGO MINDSTORMS EV3
LEGO Education WeDo 2.0
Go Direct Force and Acceleration
Note: | The possible number of reporters is infinite, as there is no limit to how many variable and list reporter blocks can be created. |