The break statement is used to break out of a loop before the conditional expression is met.
For example:
while(i < 10)
if(i == 5)
// Break prematurely from the loop
break;
endif
endwhile
Here's an example ising the CXACULAB.DLL function library for waiting for an inbound call to be detected:
// Loop indefinitely
for(;;)
x=CCwait(port,chan,0);
if(x==CS_INCOMING_CALL_DETECTED)
applog("Received incoming call on port=",port," chan=",chan);
// break from the loop
break;
else
applog("Unexpected event x=",x, " whilst waiting for incoming call");
endif
endfor