Calling the Current List (VB6 me parallel)

David McFarlane mcfarla9 at msu.edu
Fri Nov 6 17:24:58 UTC 2009


Ariana,

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


>In the middle of a list's proc, if a subject hits the space bar I want
>it to terminate the list.  I got that to work, but I have 29 of these
>lists that all need the same thing to happen.  If I do each one
>independently I can now verify that I get a script to large to compile
>error.
>Instead, of what I have now:
>If ImageDisplay1.RESP = "{SPACE}" then
>List1.Terminate
>Goto Label3
>
>I want to change List1 to be the current list, whichever one it is.  I
>know that in standard VB6, I could just substitute in me.Terminate.
>How can I do this in E-Prime?
>
>Thanks for all your help in advance!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---



More information about the Eprime mailing list