John,
OK, that's more interesting. A few thoughts.
1) This is exactly the sort of thing where PST Web Support can help,
and you should go there first
(
http://support.pstnet.com/e%2Dprime/support/login.asp ). In PST's
business model, technical support ultimately *is* their technical
documention, so don't be shy.
2) If you have EP1, then you can see how this works by looking at the
generated code -- that's how I figure out a lot of this
stuff. Simply open E-Studio, add a Slide to SessionProc, add a
couple SlideText objects to your Slide, Generate the program, then
look at the generated code in the Script window -- look in the
InitObjects() routine. Note this will not work with EP2 -- EP2 does
all this work in the new Slide1.LoadProperties routine, which makes
the generated code a lot tidier, but also hides all these important &
useful details from you. (I'm glad I still have EP1 to fall back on
for this sort of thing.)
3) You can look at the SlideText topic in the E-Basic Help facility
for some details on how to use SlideText with Slides in inline
code. But that illustrates only how to use existing SlideText
objects, not how to create & add new ones. For that, you need to
apply more general knowledge of E-Basic/VBA, and add that to
knowledge about SlideState objects.
4) This time I will spare you some trouble and go ahead and document
this a bit. I followed my own procedure in #2, and put together the
following sketch:
Dim slText as SlideText
Set slText = New SlideText
slText.Name = "Text1"
InitSlideTextDefaults slText
slText.Text = "Text"
slText.X = "10%"
slText.Y = "10%"
' more slText properties as desired...
' ...
StimSlide.States("Default").Objects.Add slText, "Text1"
This adds a SlideText item named "Text1" to the "Default" SlideState
of StimSlide -- of course, you would have to modify this to fit your
situation. The latest EP2 E-Basic Help indicates that you must also
do StimSlide.LoadProperties after all this, but that sounds wrong to
me, so you just have to sort that out on your own.
Remember that if you want to then use attribute references to control
property values of your added SlideText objects (e.g., .Text), you
will also need to add lines like
Dim slText as SlideText
Set slText = CSlideText(Slide1.States("Default").Objects("Text1"))
slText.Text = c.GetAttrib("StimAttrib")
Set slText = Nothing
or, if you prefer more compact code,
Set CSlideText(Slide1.States("Default").Objects("Text1")).Text = _
c.GetAttrib("StimAttrib")
as appropriate (and modified as needed).
I leave it to you to take it from there. Doing all this Slide
sub-object management yourself in inline code is not for the faint of heart!
-----
David McFarlane
E-Prime training
online:
http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter: @EPrimeMaster (
https://twitter.com/EPrimeMaster)
/----
Stock reminder: 1) I do not work for PST. 2) PST's trained staff
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 make full use of
it. 3) In addition, PST offers several instructional videos on their
YouTube channel (
http://www.youtube.com/user/PSTNET ). 4) If you do
get an answer from PST staff, please extend the courtesy of posting
their reply back here for the sake of others.
\----
At 12/19/2012 10:59 AM Wednesday, JACanterbury wrote:
>Hi David,