That said, here is my take...
I see two questions here: (1) How to find the sum of the Weights in
a List (which I gather is what you mean by "total number of samples
and cycles")? (2) How to pass a value to Procedures at the same or
higher working/logging levels? And the answers remain the same for
EP1 or EP2. So...
(1) Well, based on both my own experience and information from
Brandon Cernicky (one of the architects of E-Prime), E-Prime has no
facility for providing the sum of Weights of a List; in fact, EP does
not even have a facility for reading any of the individual Weight
values. So you can only resort to a workaround, as outlined by
Brandon himself long ago at
http://support.pstnet.com/forum/Topic1244-5-1.aspx : create an
attribute in the List to mirror the Weight values. Your program
could then sum those mirrored values, etc. Of course, that puts the
burden upon you to make sure that whenever you change a weight value
you also change the mirrored value in the List.
So let me here propose an alternative workaround that occurred to me
just now. Although EP does not have a List.GetWeight method, it does
have a List.SetWeight method. So just reverse Brandon's advice: Add
a normal List attribute where you enter the intended weights, and
then use inline code to set the List Weights using the "mirrored"
values at runtime. That should be interesting.
(2) This question comes up again and again and again (even this week
already), and the answer is simple: You need to study Chapter 4
("Using E-Basic") of the User's Guide that came with E-Prime, and use
a global variable. But I will elaborate a bit this time.
First, this has nothing to do with whether or not the "context is
passed to TrialProc by value and not by reference". Rather, you
simply misunderstand the concept of the EP "Context", not surprising
because PST does such a poor job of explaining this (although you
could start again with Chapter 4 of the User's Guide). Contrary to
common impressions, Context attributes are *not* variables. Only
variables are variables. And attributes propogate only downward to
lower branches off of the same Procedure, they do *not* propogate
upward or "sideways", not even to the next iteration of the same
Procedure (because to do the next iteration you must first exit the
Procedure, pop up a level, and then push down into the Procedure again).
So that is the long way of saying that you want to use a global
variable for this, not an attribute, and you will learn about that in
Chapter 4. Attributes have an entirely different purpose, although I
do not know how to describe that at the moment so this will have to suffice.
-- 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)
Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
www.cognitology.eu
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-p...@googlegroups.com.
To unsubscribe from this group, send email to e-prime+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
For that, use the LBound() and UBound() functions -- see the
"Arrays", "LBound", and "UBound" topics in the E-Basic Help facility
(which serves as the E-Basic programming reference), or read up on
arrays in any available reference on Microsoft Visual Basic for
Applications, of which E-Basic is a derivative. By comparison,
List.Size returns the number of levels (rows) in a List (and thus I
suppose acts like the size of an array), but this does not take into
account the Weights. Each List has an associated Order object, and
Order objects have a Count property (as you have already observed),
but I cannot even begin to describe how Order objects work.
Again, Lists are *not* arrays, just as attributes are *not*
variables. They each have distinct uses and behaviors.
>Regarding attributes, I simply don't understand why you would have
>attributes..
I am still working on a definitive answer to that, stay tuned...
In the meantime, please look at my posts at
http://groups.google.com/group/e-prime/browse_thread/thread/5425e03968cab428
and
http://groups.google.com/group/e-prime/browse_thread/thread/b0ce54870b723fc3
for some very general introductory guidance.