Calling the Current List (VB6 me parallel)

139 views
Skip to first unread message

Ariana Rubin

unread,
Nov 6, 2009, 11:25:16 AM11/6/09
to E-Prime
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!

liwenna

unread,
Nov 6, 2009, 12:19:49 PM11/6/09
to E-Prime
Hey Ariana,

I am short in time right now so I'll be really brief.... I still
wonder why you want to use all these lists instead of just one lists
and 4 repeating slides.. but using the info in the topic
how to... make a 'for 0 to x' variable that can insert digits IN an
attribute name? (http://groups.google.com/group/e-prime/browse_thread/
thread/e955c26100f8d2bc) you should be able to figure something
usefull out (read Ben's responses, not my lengty questions ;) ).

greets,

liw

David McFarlane

unread,
Nov 6, 2009, 12:24:58 PM11/6/09
to e-p...@googlegroups.com
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

David McFarlane

unread,
Nov 6, 2009, 12:32:25 PM11/6/09
to e-p...@googlegroups.com

>that all boils down to one simple elegant line of script:
>
>CList( Rte.GetObject( c.GetAttrib("Running") ) ).Terminate

Editorial comment: Well, not as simple & elegant as me.Terminate in
VB6, but you get the idea.

Reply all
Reply to author
Forward
0 new messages