Variables and lists
The Variables category (internally called "data") holds two kinds of storage: variables, which each hold one value, and lists, which hold many values in order. You create variables and lists with the "Make a Variable" and "Make a List" buttons at the top of the category; Bilup also has a dedicated variable manager for editing them in bulk.
A variable or list can be for all sprites (global) or for this sprite only (local to one sprite and its clones).
Variables
variable(reporter) reports the variable's current value. Checking its box on the palette shows a monitor on the stage.- set
variableto0stores a value. - change
variableby1adds a number to a numeric variable. - show variable
variable/ hide variablevariableshows or hides the stage monitor.
Lists
list(reporter) reports the list's contents.- add
thingtolistappends an item to the end. - delete
1oflistremoves an item by position (the menu also offerslastandall). - delete all of
listempties the list. - insert
thingat1oflistadds an item at a position, shifting the rest down. - replace item
1oflistwiththingoverwrites an item. - item
1oflistreturns the item at a position. - item # of
thinginlistreturns the position of an item, or 0 if not found. - length of
listreturns how many items the list holds. listcontainsthing? reports whether the list holds an item.- show list
list/ hide listlistshows or hides the list monitor on the stage.
Bilup and TurboWarp extras
listas JSON (data_listjson) reports the whole list as a JSON array string, useful for saving or sending list data as text.
See also
- The variable manager
- Cloud variables
- Operators blocks for working with values
- Bilup extras