Reply To: Multi dimension arrays in OAL

homepage Forums BridgePoint/xtUML Usage and Training Multi dimension arrays in OAL Reply To: Multi dimension arrays in OAL

#1292
keithbrown
Keymaster

Multi-dimensional arrays are supported both as transients and modeled attributes. As with single-dimensional transients as arrays in OAL, you must set the maximum extent first:

// Right:
my_array[1][1] = 3;
my_array[0][0] = 0; // Order of this and next two lines does not matter
my_array[0][1] = 1;
my_array[1][0] = 2;

// Wrong:
my_array[0][0] = 0;
my_array[0][1] = 1; // Parser will indicate Array Index Out of Bounds
my_array[1][0] = 2;
my_array[1][1] = 3;