menu

Normal variables are stored in a key-value format. However, sometimes that doesn't provide enough functionality. Enter: arrays

Arrays are a type of data structure that most languages have. In essence, they are a list of variables.

To an array, order matters. This makes them incredibly useful in many occasions.

Formatting

In BBTag, arrays are formatted in JSON style. For example:

["This", "is", "an", "array"]

The square brackets [] designate the start and end of the array. Within them are the elements, separated by commas. An element can be a number, a boolean (true/false), or a string surrounded by quotation marks " ". When blargbot sees this pattern in certain functions, it will recognize it as an array.

Currently, arrays can be assigned to variables using the following methods:

{set;name;["an", "array"]}
{set;name;an;array}

Why do my arrays look weird?

At some point, you may notice that your arrays look something like this:

{"v":["This","is","an","array"],"n":"name"}

Don't worry! This is completely normal and intentional, as it allows for communication between array manipulation tags. Just keep using them as you normally would.

Functions

There are various tags that can manipulate arrays, such as {push} or {slice}. For more information about these, check the tag list. Array-compatible tags will have a note beside them.