<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;color:#000000">me.crash() is what I use.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 5 Oct 2019 at 05:34, Forrest Cahoon &lt;<a href="mailto:forrest.cahoon@gmail.com">forrest.cahoon@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I&#39;m writing some code something like this:<br><br>class MyMidiThing<br>{<br>    // static int stores midi channels to use<br>    0 =&gt; static int nextChannel;<br><br>    // instance variable stores midi channel for object<br>    int channel;<br><br>    fun init()<br>    {<br>        if (nextChannel &gt; 15) {<br>            // NO MORE MIDI CHANNELS!<br>            // PANIC! EXPLODE! ... how?<br>        }<br>        nextChannel =&gt; channel;<br>        nextChannel++;<br>        // ... go on to do stuff ...<br>    }<br>    // ...<br><div>}</div><div><br></div><div>Clearly I want to do something when there are no more MIDI channels available that stops the program and prints error info, like a stack trace.<br><br></div><div>In general programming terminology, to throw an exception.</div><div><br></div><div>I&#39;ve been scanning the documentation, and maybe I&#39;m dense, but I can&#39;t find out how to do what I want here.</div><div><br></div><div>Suggestions?</div><div><br></div><div>Forrest</div><div><br></div></div>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div>