#2176 closed enhancement (fixed)
Better error message for missing else in if-equation
| Reported by: | Per Östlund | Owned by: | probably noone |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.9.4 |
| Component: | Backend | Version: | trunk |
| Keywords: | Cc: |
Description (last modified by )
If-equations with variable conditions must have an else-clause. We detect this, but for a model such as
model VarConditionNoElse
Real x(start = 0.0), y(start = 2.0);
equation
if x < 1.0 then
x = time;
y = y + x;
elseif x >= 1.0 then
x = 1.0;
y = der(y);
end if;
end VarConditionNoElse;
we print out an error message like
If-equation with conditions that are not parameter expressions must have the same number of equations in each branch, equation count is {2,2,0} for each respective branch
So it's not very clear that the real error is a missing else-clause. We could improve this by simply printing out a different error for the case where the else-clause is missing.
Change History (4)
comment:1 by , 12 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:3 by , 10 years ago
| Milestone: | Future → pre1.9.4 |
|---|
It doesn't make sense to keep closed ticket in the "Future" milestone that were simply forgotten to assign to the correct milestone in the past.
comment:4 by , 8 years ago
| Milestone: | pre1.9.4 → 1.9.4 |
|---|
Removing the pre1.9.4 milestone in favor of 1.9.4.
Note:
See TracTickets
for help on using tickets.

Fixed in r16054.