Skip to main content

Remove Item Number From

Removes the element corresponding to the item number and returns the altered list.

Remove Item Number From block

Description​

The Remove Item Number From block removes the element corresponding to the item number and returns the altered list. This is a code block part of the Lists drawer.

Usage​

Use Remove Item Number From to delete specific elements from a list by their position. This is useful for filtering lists, removing processed items, or dynamically managing list contents based on index positions.

Syntax​

Input:

  • A number (the index of the item to remove)
  • A list to remove from

Notes​

  • Returns the modified list with the element removed
  • Elements after the removed item shift down to fill the gap
  • List indices in StarLogo Nova start at 1
  • Returns an error if the index is out of bounds