#### 37.4.1 Understanding list-variable syntax

To create a list variable, all you have to do is use a DITA2Go macro variable name with an index value in brackets, similar to C-language array notation:

    $$listname[index]

For example:

    $$mylist[$$_count]          a variable as the index
    $$mylist[2]                 a constant as the index
    $$mylist[($$myindex + 1)]   an expression as the index

List indexes can be nested

The index is a string, not just a number, so it can be anything, even another nested list reference:

    <$$mylist[$$another[one]]>

You can access the number of items in the list with <$$mylist[]>.

Previous Topic: 37.4 Using multiple-value list variables

Next Topic: 37.4.2 Assigning a value to a list-variable item

Parent Topic: 37.4 Using multiple-value list variables

Sibling Topics:

37.4.2 Assigning a value to a list-variable item

37.4.3 Initializing list variables

37.4.4 Using macros to process lists

37.4.5 Using pointers to process lists

37.4.6 Using a list instead of a conditional expression

Table of Contents • Index