using attributes to set level Weight?

David McFarlane mcfarla9 at msu.edu
Tue Mar 2 19:51:27 UTC 2010


Alex,

Standard reminder:  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.

That said, here is my take ...

First, in this respect EP2 works the same as EP1.1.  Just the same, I 
do not understand why anyone persists in running EP1.1 when they can 
easily download & install EP1.2, which may fix some problems in EP1.1 
as well as add more capability.

Second, if you look more carefully, you will almost certainly 
discover that EP *did* change the weight of your List 
level.  However, it just did not change the total number of levels 
run, i.e., the .ResetCondition or .TerminateCondition.  If you look 
at the full generated code, you will see a pair of lines in 
InitObjects() such as

         Set TrialList.TerminateCondition = Cycles(1)
         Set TrialList.ResetCondition = Samples(2)

You need to add some lines like this in your inline code.  For 
instance, when in my own example I changed the weight of level 1 from 
1 to 2, that changed the total levels to run to 3, so I used the 
following inline code:

TrialList.SetWeight 1, c.GetAttrib( "WeightNumber" )
Set TrialList.ResetCondition = Samples(3)
TrialList.Reset

Of course, getting the correct number of levels to run can be tricky, 
but you can take it from there.  (Note also that EP does not provide 
a List.GetWeight method to help you, as documented at 
http://support.pstnet.com/forum/Topic1244-5-1.aspx .)

-- David McFarlane, Professional Faultfinder
"For a successful technology, reality must take precedence over 
public relations, for nature cannot be fooled."  (Richard Feynman, 
Nobel prize-winning physicist)


>I have a Trial List with 4 levels, corresponding to 4 different
>conditions. I want to present the first condition (i.e., the first
>level in the list) a varying number of times during a given cycle. So
>essentially, rather than having the Weight for the first level set to
>a fixed number, I would like to use an attribute in the Weight column
>that refers to another variable, e.g., [WeightNumber]. However, E-
>Prime won't let me use attributes in this column (I am using E-Prime
>1.1, I don't know if this is possible in version 2).
>I have tried inserting an inline code just before the TrialList in
>order to set the Weight:
>          TrialList.setWeight 1, c.getAttrib("WeightNumber")
>          TrialList.reset
>This doesn't work at all; the Weight appears to remain the default
>number 1.
>Does anyone have any ideas?
>Thanks!

-- 
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