Page 1 of 1

Do we have an Exit?

PostPosted: Wed Apr 15, 2009 11:35 pm
by Caligari
Is there an Exit command or method for Cobra that I've missed? I'm looking for something that stops program execution from anywhere, probably providing an optional status code.

I found System.Environment.Exit (I'm doing this from memory, but I think that is it), which does what I'm talking about, but I'm a little surprised there isn't anything in Cobra itself to at least shortcut to that.

- Caligari

PS. I've revised the regex sample, but I've done so twice and now I want to merge the two sets of changes before I submit it again. Soon, I promise.

Re: Do we have an Exit?

PostPosted: Thu Apr 16, 2009 12:05 am
by Charles
I've just added CobraCore.exit(code) if you happen to be using Cobra out of a workspace. It's not much shorter than Environment.exit(code) (CLR) or System.exit(code) (JVM). I added it primarily so that it will be cross platform.