Marty Nelson wrote:

We have users writing extension scripts that execute from C#, and may be called multiple times (for example, hooked up to a Change event of some object or event in the main application)

Is sys.exit(1) an acceptable way for them to exit the script (used like an early return in C#)? Is there a better way? Does it do anything to the ScriptScope that is reused?

It would seem acceptable - it raises the SystemExit exception which your hosting application would need to catch and ignore.

A better structured way (in my opinion) would be to use a procedural or object oriented approach in the scripts and allow them to terminate normally.

Michael Foord

Thanks!

=======
Notice: This e-mail message, together with any attachments, contains
information of Symyx Technologies, Inc. or any of its affiliates or
subsidiaries that may be confidential, proprietary, copyrighted,
privileged and/or protected work product, and is meant solely for
the intended recipient. If you are not the intended recipient, and
have received this message in error, please contact the sender
immediately, permanently delete the original and any copies of this
email and any attachments thereto.

------------------------------------------------------------------------

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to