Delete () of () | |
delete () of [ v] | |
Category | List |
Type | Stack |
Introduced in | 1.3 |
The Delete () of () block is a List block and a Stack block. The block can delete the item number inputted.
Example Uses
If there is a list of multiple items, and only one item needs to be removed, the Delete () of () block can do the job.
Some common uses for this block are:
- Deleting redundant items
delete (1) of [stuff v] add [water] to [stuff v]
- Removing the last item in a stack
delete (length of [stack v]) of [stack v]
Text Inputs
In Scratch 2.0 and earlier, this block had two other options: "last" and "all". When these options were removed from the block following the release of Scratch 3.0, they were not fully removed, just hidden. The "all" input was replaced with this block:
delete all of [list v]
However, it and the "last" option can still be used by copying and pasting the text "last" into the field where you type the number. This also works with the text "random" (which deletes a random item of the list).
See Also
- Add () to ()
- Insert () at () of ()
- Replace Item () of () with ()
- Removing an Item from a List (by value)