Skip to content

MvDIMENSION#


If you think of a single dimension array as an simple numbered list, a two dimension array can be though of as a spreadsheet with numbered rows and columns. Miva Script provides flexible tools for creating even more complex data structures.

Miva Script arrays are fully multi-dimensional (up to the limits of the system). If a value is assigned to an index or member that did not previously exist, the entry will be created.

Syntax
<MvDIMENSION INDEX = "numberic: { expression } | literal"> 

Attributes#

Attribute Description
INDEX Declares the index of the array in NAME that will receive the VALUE.

Only allowed between <MvASSIGNARRAY> and </MvASSIGNARRAY>.

Two Dimensional Array#

A tabular representation of the array declared below could look like this:

Column 1 Column 2
Row 1 100 200
Row 2 300 400

Example#

Result: 300
<MvASSIGNARRAY NAME="l.coordinates" VALUE="{ 100 }">
    <MvDIMENSION INDEX="1">
    <MvDIMENSION INDEX="1">
</MvASSIGNARRAY>

<MvASSIGNARRAY NAME="l.coordinates" VALUE="{ 200 }">
    <MvDIMENSION INDEX="1">
    <MvDIMENSION INDEX="2">
</MvASSIGNARRAY>

<MvASSIGNARRAY NAME="l.coordinates" VALUE="{ 300 }">
    <MvDIMENSION INDEX="2">
    <MvDIMENSION INDEX="1">
</MvASSIGNARRAY>

<MvASSIGNARRAY NAME="l.coordinates" VALUE="{ 400 }">
    <MvDIMENSION INDEX="2">
    <MvDIMENSION INDEX="2">
</MvASSIGNARRAY>

<MvEVAL EXPR="{ l.coordinates[2][1] }"><br>