From: Oliver Beckstein (oliver_at_biop.ox.ac.uk)
Date: Wed Feb 12 2003 - 17:22:38 CST

Hi Justin,

many thanks for your help. Your suggestion works and is good enough for
me, even within the limitations that you pointed out.

Best wishes,
Oliver

> Note that my suggestion won't get text that has 'Info:' or 'Error', since
> this text is written directly by VMD to stdout, not to the Tcl interpreter.
> It only gives you the result of executing Tcl commands. I don't know of any
> way of intercepting text sent to stdout.

> > I think all you have you do is replace "eval $line" in your script
> > with the following:
> >
> > set rc [catch $line result]
> > if { $rc } {
> > puts $sock "Error executing comand '$line': \n$result"
> > } else {
> > puts $sock $result
> > }
> > This should also fix the problem with erroneous commands causing the server
> > to fail. What's probably happening is that Tcl is shutting down the socket
> > when an uncaught error occurs during execution of the read handler.

-- 
Oliver Beckstein * oliver_at_bioch.ox.ac.uk
 http://indigo1.biop.ox.ac.uk/oliver/