Spinroot

A forum for Spin users

You are not logged in.

#1 2012-04-25 10:28:58

feng_lei_76
Member
Registered: 2011-05-13
Posts: 43

break statement doesn't work in for structure

SPIN version 6.1.0 -- 4 May 2011
iSpin version 1.0.6 -- 24 October 2011

If for is implemented as do loop, why doesn't it allow break inside?

You may create the syntax error with the following code.

active proctype x()
{
    byte i;
       
    for (i : 1..10)
    {
        if
        :: i > 5 -> break
        :: else
        fi
    }
}

Offline

#2 2012-04-26 05:42:02

spinroot
forum
Registered: 2010-11-18
Posts: 678
Website

Re: break statement doesn't work in for structure

it is indeed a bug -- it will be fixed in version 6.2.0

Offline

Board footer

Powered by FluxBB