From Test-Scratch-Wiki

A list that is holding three items.

An item is a part of a list that works in a similar way to a variable. Each list can theoretically hold an unlimited amount of items, though too many will probably crash Squeak.

An item can be any value supported by Scratch, such as a boolean (true or false), string, or number. An item cannot contain a list in Scratch, though in the Scratch Modification BYOB, it can. Lists of lists is a powerful way to store data, so there have been suggestions to include lists as a standard data type in Scratch 2.0 or create a new data type called "tables" which work like a spreadsheet.

Definition

An item is a lot like a variable. You can modify, read, and create items. Items of a list can be used to replace all the variables of a project. However it will not be as easy to read, as values will be referred to by numerical indices, not names.

Related Blocks

Nearly all of the List blocks, found in the Data palette, underneath the variables, can be used in conjunction with items:

— Adds an item to the bottom of a list

— Removes an item from a list

— Adds an item to a list and puts it wherever specified

— Replaces an item's content

— Reports what the item contains

— Reports how many items are in a list

— Checks if a list has an item that holds the given text

These blocks give more control over items than other blocks can with variables — there are no blocks that will create or delete variables, except in some Scratch modifications.

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