Posted Thu, 08 Oct 2015 08:52:39 GMT by Julian Mamo
We are trying to implement a While loop. At the moment we are using a foreach with an ifelse statement to do this, but were wondering if a while loop can be used directly?

Thanks,

Julian
Posted Thu, 08 Oct 2015 09:41:55 GMT by Filip Claeys
MSL does not have WHILE loops. Nor does it have FOR or IF-THEN constructs. As you mentioned, it does have FOREACH and IF-THEN-ELSE though.

MSL is not a regular procedural language such as C(++), FORTRAN, Pascal, VB, Java, ... in the sense that we are not dealing with [u]statements[/u] that are executed one after the other. Instead, we have [u]equations[/u] that are automatically sorted. Consequences of this are that we always need a left-hand-side as well as a right-hand-side for any equation at any time (which is why the ELSE part in IF-THEN-ELSE constructs is indispensable) and that FOREACH constructs lead to an expansion (unrolling) of the equation set. WHILE and plain FOR (non-expanded) are therefore not possible.
Posted Thu, 08 Oct 2015 10:00:53 GMT by Julian Mamo
Ok understood. Thanks for your reply.

You must be signed in to post in this forum.