[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Prematurely exiting a loop



Hi Jonathan,


You could try using block:

(
block({| break | 
inf.do({| i |
i.postln;
if (i > 5, { break.value })
})
})
)


Cheers,

Sergio

--
Sergio Luque






On 26 Dec 2018, at 18:00, info@xxxxxxxxxxxxxxxx wrote:

Hey all,

Is there any equivalent to the C/C++ break statement in SuperCollider, For the purpose of prematurely exiting a while or do loop?

best,

Jonathan

--
JC Reus

WEB: jonathanreus.com