Skip to content

Create a list of items

bartbutenaers edited this page Aug 25, 2018 · 2 revisions

A list of items can be created, which allows you to handle the items as a single (list) item. There are several options available to create such a list.

In the most simple case, a list is needed where all items have the same value. The following animation shows how create a list that contains five items, which all have the same value 'myItem':

blockly_list_repeat

Another case is a list that contains a known number of fixed items. The following animation shows how to create a list with four items 'value 1', 'value 2', 'value 3' and 'value 4':

blockly_list_empty

When you have a text containing a list of items, it is possible to create a list from that text. In between the values there will be some text, that separates the individual items. That separating text is called the separator or delimiter. For example in 'value1;value2;value3', the ';' character will be the delimiter.

The following animation shows how to create a list starting from a text 'value 1#value 2#value 3', using a '#' character as delimiter:

blockly_list_text

In the dropdown there is another option available to do the reverse, i.e. create a text (with a specified delimeter) from a list.