Wow, was that interesting. In the past I have just put a list of all
my Lists into my script and terminated every one whether running or
not, there is no error in terminating a non-running List. But that
is clumsy, and your question got me thinking. To the lesson in a
moment, but first a few standard reminders...
1) I do not work for PST. 2) PST's trained staff really does like to
take any and all questions at
http://support.pstnet.com/e%2Dprime/support/login.asp , and they
strive to respond to all requests in 24-48 hours. So don't be shy
there. 3) If you do get an answer from PST Web Support, please
extend the courtesy of posting their reply back here for the sake of others.
OK, on with the lesson. You can always get the the name of the
currently running List from the "Running" attribute, e.g.,
MsgBox c.GetAttrib("Running")
Ah, but how to use that to control the actual List object? Next, we
look into the casting functions, which you may read about in the
Casting topic of the online E-Basic Help. But you cannot simply do
CList(c.GetAttrib("Running")).Terminate, since the CList() cast needs
an object as an argument, not a text string. So, how to get the
object that corresponds to the text value in Running? For that, you
want the GetObject method of the Rte object, which you may read about
in the Rte topic of the online E-Basic Help.
So now you want to get the text value from the Running attribute, use
that to reference the corresponding List object, cast that into an
object of class List, and run its Terminate method, and (whew!) that
all boils down to one simple elegant line of script:
CList( Rte.GetObject( c.GetAttrib("Running") ) ).Terminate
Note that understanding these underlying principles opens up whole
new worlds of possibilities!
-- David McFarlane, Professional Faultfinder
Editorial comment: Well, not as simple & elegant as me.Terminate in
VB6, but you get the idea.