Opened 14 years ago

Last modified 14 years ago

#1323 closed defect (fixed)

Array indexing with another array

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Version: 1.6.0
Keywords: Cc: Martin Sjölund,

Description

From Tom Short via openmodelicainterest:
Here is an example that does not work in OpenModelica:

{{{class ArrayTest

Real a[4];
Integer idx[2] = {2,4};

equation

a[{1,3}] = {1,3};
a[{2,4}] = {2,4};
a[idx] = {2,4};

end ArrayTest;}}}

The error I get is given below. I get the same type of error for single- and two-dimensional arrays.
{{{Error: Index out of bounds. Adressing position: idx[1] and position idx[2], while array length is: 4
Error: Error occured while flattening model ArrayTest}}}

Change History (1)

comment:1 by Per Östlund, 14 years ago

Fixed in revision 6614.

Note: See TracTickets for help on using tickets.