- Index
- » Programming
- » Modelica Language
- » How to count? ( i++ )
Page Start Prev 1 Next End
How to count? ( i++ )
How to count? ( i++ )
Apr-27-12 12:25:03
Hello,
I am trying to keep tab of the number of times that a curve passes a certain line but I can't get the counter to work (i++ style).
e.g.:
algorithm
if y==constant then
i:=i+1
end if;
This only makes i:=i+1 at the moment when condition is true.. afterwards it reverts to its old value. How do I change it for good?
Help is much appreciated.
Edited by: cporowski - Apr-27-12 12:31:03
Re: How to count? ( i++ )
Apr-27-12 16:34:03
Code:
when cond then
i = pre(i)+1;
end when;
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Programming
- » Modelica Language
- » How to count? ( i++ )
There are 0 guests and 0 other users also viewing this topic