placeholder in object name?
Michiel Spape
Michiel.Spape at nottingham.ac.uk
Tue Feb 15 15:42:59 UTC 2011
Hiya,
Fair question, it sometimes bugs me as well. Perhaps David can provide a better answer than I, but I believe, tentatively, no. That is, we can't just make variables on the fly, such that
Dim part1 as string
part1 = "a"
Dim part1 & "b" as string
...Will not result in a new variable, called ab, being created, but rather that an error is being thrown. Sadly. A true dynamic programming language should have such abilities, but not, as far as I know, VB (although one might make such a programming language using VB, perhaps?).
That said, there is usually a way around it in the form of using arrays or creating whole new objects. I.e. you can not only have such simple things like an array of integers, but also create an indexed object, so that decksoutcome(1).States(showdecks) should be possible. I personally find it easier, however, to start using a different language rather than getting frustrated with E-prime.
Best,
Mich
Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
www.cognitology.eu
-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of liwenna
Sent: 15 February 2011 14:38
To: E-Prime
Subject: placeholder in object name?
Hi all,
I got a question!
"Long explanation
if not interested goto *****
In an experiment one of four procedures will be run in order to show
the outcome of a chocie made by the participants (choose one of four
decks, the outcome displays differ per choice made so the program is
redirected to one of four procedures that hold the different outcome
slides).
On each of these outcome procedures I have an inline to redirect the
program in case of participants clicking outside a certain button.
This inline starts with collecting the mouse responses and in this
line of code the name of the slideobject on which participants clicked
has to be specified. The name of this slidedisplay obviously differs
over the four procedures and this difference is simply the answer (a,
b, c, d): i.e. decksoutcomeAupdatedcounters,
decksoutcomeBupdatedcounters etc.
Now.. this inline has to appear in all four procedures but the
slideobject that is defined has to differ on this one letter... and
although it is little effort to simply make four separate inlines (as
I now did) I would so much like to know if it would have been possible
to use one single inline for all four procedures in which, somehow,
the value of the attribute "response" (or... the variable strhit for
that matter) is placed into the objectname.
*****
I was trying to get something like this working...:
dim r as string
r$ = c.getattrib("response")
Set theState = decksoutcome&r$&updatedcounters.States(showdecks)
... but to no avail.
Does anyone know how to do this? I'd like to learn for future use :)
Thanks in advance,
AW
--
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.
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.
--
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