Omni Systems, Inc. Mif2Go User's Guide, Version 55

<< Prev | Next >>

> 28 Working with macros > 28.4 Using multiple-value list variables > 28.4.2 Assigning a value to a list-variable item

### 28.4.2 Assigning a value to a list-variable item

To specify the value of an item in a list, use an assignment that includes the index position of the item in brackets (see §28.3.2 Assigning values to macro variables):

<$$listname[index] = somevalue>

How the value is assigned depends on whether you include or omit a default value:

Set a default value

Omit a default value.

Set a default value

If you provide a value for list item 0 (zero), that value is used for any item in the list for which you have not specified another value. For example, suppose you specify:

<$$mylist[0] = Error!>

Then if you use <$$mylist[15]>, without ever having assigned a value to the 15th item in the list, that value becomes “Error!”.

Omit a default value

If you do not provide a value for <$$mylist[0]>, and you use <$$mylist[15]>, the value of <$$mylist[15]> is 0 (zero).