Working with Lists and Associative Arrays
Lists and associative arrays allow you to create dynamic data structures in PV‑WAVE. Lists contain collections of variables and/or expressions. An associative array is like a list, except each element in an associative array is given a unique name. This name is then used to reference its associated array element.
Unlike other kinds of arrays, the elements of a list or associative array do not have to be the same data type. Furthermore, the contents and size of lists and associative arrays can be modified dynamically, while an application is running.
note | A list or associative array definition creates a new data type. |
Figure 7-1: A list and Associative Array shows a list, on top, consisting of an array of variables and expressions, which do not have to be of the same data type. An associative array, shown on the bottom, consists of pairs of key names (strings) and values (variables or expressions). A list is referenced using subscript numbers, just like a 1D array. The elements of an associative array are referenced by key name.