Delete All of ()
delete all of [ v]
Category List
Type Stack
Introduced in 3.0

The delete all of () block is a list block and a stack block. It removes all items in the specified list. Prior to Scratch 3.0, the "all" option was included in the Delete () of () block instead.


Because it deletes all the items in a list, it can be used in a wide variety of situations.

When a pattern is repeated correctly:

. . .
if <(played notes:: list) = (correct notes:: list)> then
    delete all of [played notes v]
    generate new sequence:: custom
    . . .

When all enemies are defeated:

. . .
if <(enemies) = (0)> then
    delete all of [enemies list v]
    . . .

Resetting a list:

. . .
delete all of [list v]
say [The list has been reset.]
. . .


Main article: List of Block Workarounds

This block can be replicated by deleting all items individually.

repeat (length of [list v])
    delete (1) of [list v]

It can also be easily replicated by using "all" as an argument in the "delete () of list" block with the Join ()(): delete (join [all] []) of [list v]

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.