- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » UNKNOWN_SUBSCRIPT in for loops
Page Start Prev 1 Next End
UNKNOWN_SUBSCRIPT in for loops
UNKNOWN_SUBSCRIPT in for loops
Mar-16-11 06:56:53
I'm trying to loop through a vector of models, but I am getting a UNKNOWN_SUBSCRIPT error.
Here is some of the related code:
Code:
House houses[10];
algorithm
fixed_cost := 0;
for k in 1:10 loop
fixed_cost := fixed_cost + houses[k].economic_out.fixed_cost;
end for;
omc gives the following error:
Code:
EnergySimTest.cpp:1852: error: ‘$Phouses$lBUNKNOWN_SUBSCRIPT$rB$Peconomic_out$Pfixed_cost’ was not declared in this scope
I have checked to see that replacing [k] with [1], [2], etc. works.
Is modelica unable to dynamically generate iterators for a vector of models? (I know it works for a vector of Reals)
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » UNKNOWN_SUBSCRIPT in for loops
There are 0 guests and 0 other users also viewing this topic