@clement That was my original thought, it’s just that the location where i need to conditionally exit is not inside a function. My code is structured like this:
setup code (check for dongle, exit if not found, otherwise exec some code from the dongle)
i can certainly move the setup code inside main, it just interested me that Rhino was exiting when I used exit(). I thought exit() was just supposed to quit the interpreter; i guess i don’t understand the intricacies about how the interpreter runs when hosted in another application.
edit: I suppose the easier fix would be to add a second conditional check in the final if clause to avoid running main() altogether.