Data Block

The variable blocks are color-coded orange, and the list blocks are color-coded dark red.

Variable Block

Variable Blocks are used to hold values and strings in variables, as well as display them using monitors.

BlockFunction
set () to ()The block will set the specified variable to the given value: a string or number.
change () by ()The block will change the specified variable by a given amount.
show variable ()The block shows the specified variable's Stage monitor.
hide variable ()The block hides the specified variable's Stage monitor.
variableThe block simply holds its variable

List Block

They are color-coded red and are used to manipulate lists.

evive Notes Icon
Note: A list (also called an array in other programming languages) is a tool that can be used to store multiple pieces of information at once. It can also be defined as a variable containing multiple other variables. A list consists of a number paired with items. Each item can be retrieved by its paired number.
Items
Items can be added to or deleted from a list manually or by programming. Holding down shift and pressing enter on a list results in a new entry above the previously selected entry. They can also be added by right-clicking the list, clicking ‘import’, and selecting a plain .txt or Comma Separated Values file. Each line in the file will become a new item in the list. They can also be exported in the same way.
Limits on list size
There is no limit to the length of an item or the number of items a list can hold, apart from an amount sufficient to crash Scratch.
BlockFunction
listThe block simply reports the items of its list as a string. 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.
add () to ()The block adds an item onto the end of the specified list, the item containing the given text.
delete () of ()delete all of ()The block can delete the item inputted, the last item, or all items of the specified list depending on the option selected.
insert () at () of ()The block inserts an item containing the given text into the list, at the given position. All values below the inserted item are passed onto the item beneath them; the last item's value is placed in a new item at the end of the list.
replace item () of () with ()The block replaces the specified item; in other words, it changes the item's content to the given text.
item () of ()The block reports the value of the specified entry in a specified list.
length of () 2The block reports how many items a list contains.
() contains () 2The block checks if any items in the specified list are equal to the given text—if at least one of them is, the block returns true; if none of them are, it returns false. The item must contain the exact text; for example, "abc" would not work if the item contained "abcde". This block is case-sensitive.
show list ()The block shows the specified list's Stage monitor.
hide list ()The block hides the specified list's Stage monitor.

This work, “Data Block”, is a derivative of “Data Block” by Scratch, used under CC BY-SA 4.0. “Data Block” is licensed under CC BY-SA 4.0 by STEMpedia.

Content is available under CC BY-SA 4.0 unless otherwise noted.

Related Tutorials, Projects & Documentation
Dabble Home Connected

Getting Started with Dabble

Getting Started with Dabble Introduction Dabble App transforms your Smartphone into a virtual I/O device and lets you control hardware using Bluetooth, communicate with it,…
PictoBlox blocks Scratch how to

Getting Started with PictoBlox

PictoBlox is a programming software based on Scratch, where you can make interactive games, animations or program robots and projects with evive, Arduino, etc..
All articles loaded
No more articles to load
PictoBlox Supported Boards
Extensions
Close Menu
×

Cart