(Redirected from () (Lists block))
Whenever a list is created, a version of the block appears with the list's name on it; this results in a version of this block for every list.
This block can be displayed as a Stage monitor.
A space is put between each item when it is called. If the length of all of the items in a list is equal to 1, no space is put between the items.
The List reporter block is used infrequently; most information needed can be accessed by using other reporters for the list. However, here are a couple uses for this block.
Some common uses for the () block:
- Join separate characters/words together:
- Setting a variable to the value of this block so that a list local to a sprite can be transferred:
set [unlock v] to (list::list)
- Main article: List of Block Workarounds
This block can be replicated with the following code:
set [count v] to  set [all are 1 v] to [true] repeat until <<(all are 1) = [false]> or <(count) > (length of [list v])>> change [count v] by (1) if <(length of (item (count) of [list v])) > > then set [all are 1 v] to [false] end end if <(all are 1) = [true]> then set [report v] to  set [count v] to  repeat (length of [list v]) change [count v] by (1) set [report v] to (join (report) (item (count) of [list v])) end else set [report v] to (item (1 v) of [list v]) set [count v] to  repeat ((length of [list v]) - (1)) change [count v] by (1) set [report v] to (join (report) (join  (item (count) of [list v]))) end end
Due to the nature of the Scratch interface, it was possible to create an input on a List block by entering %m, %n, or %s. This was patched in v423.
It is possible to rename variables, but it's not possible to rename lists.