Changes between Initial Version and Version 5 of Ticket #5526
- Timestamp:
- 2019-06-12T21:41:42Z (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #5526 – Description
initial v5 2 2 3 3 Example: 4 uniontype Index 5 record INDEX 6 list<Integer> idx; 7 end INDEX; 8 end Index; 4 {{{#!mo 5 uniontype Index 6 record INDEX 7 list<Integer> idx; 8 end INDEX; 9 end Index; 9 10 10 11 uniontype Compo 11 12 record COMPO 12 13 array<Real> co; 13 14 end COMPO; 14 15 15 end Compo; 16 }}} 16 17 Supposed we have a Compo called compo and an Index called index, the for loop gives wrong array components: 17 18 {{{#!mo 18 19 for k in index.idx loop 19 print(String(k));20 r := compo.co[k];20 print(String(k)); 21 r := compo.co[k]; 21 22 end for; 22 23 }}} 23 24 The print command gives the correct number, but k as array index 24 25 seems to have twice the value of the list member. So if it exceeds the array bounds we will see an error otherwise r has a wrong value.