SlideImage Subobject

Michiel Sovijarvi-Spape mspape at cognitology.eu
Wed Apr 25 08:35:12 UTC 2012


Hi,
I'm sorry, going through your code mainly gives me a headache. Most times
people do coding on slide "sub-objects" lead to this giant mess of code, and
unless one is working with Tobii eye-tracking, it seems seldom necessary.
For instance, how about 1) instead of NOT showing an image, it would be
preferable to read the same amount of data, so, just make a white picture
using ms paint and call that NoImage.BMP. Coders dislike this type of
strategy (since it's intentionally inefficient), but it makes perfect
experimental sense. 2) instead of showing 3 images and making one invisible,
you could just add a number of slide-states with sometimes one missing. 

Otherwise, I'd really suggest cleaning up your own code first, and then
having others to work out what is going wrong. For instance:

If (pos = 1) And (OldStim = 1) And (stim = 1) Then
    pos1 = pos1 + 1
    OldStim1 = OldStim1 + 1
    If pos1 > 10 Then
        GoTo SelectPosition
        If OldStim1 > 10 Then
            GoTo SelectOld
        Else
            RImg1.X = 441
            RImg1.Y = 384
            NImg.X = 589
            NImg.Y = 384
            c.SetAttrib "Location", "1"
            c.SetAttrib "PosOld", "1"
            Debug.Print c.GetAttrib("PosOld")
        End If
    End If
End If

.... is exactly the same as what you write, but without code that is
commented out (did you have that working in there?), indentation that makes
it slightly clear what is being end-iffed. Also note that RImg1.X should not
be a string value. 

Finally, you'll be thankful to yourself if you'd collapse some of the code,
that is, if you write "If pos = 1 And OldStim = 1 And stim = 1 Then" and a
bit later on "If pos = 1 And OldStim = 1 And stim = 1 Then", then you can
see that quite a lot of code is duplicate and not adding an awful lot. 

Hope that helps,
Michiel

-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf
Of MARILY ILLESCAS
Sent: 25 April 2012 08:49
To: E-Prime
Subject: SlideImage Subobject

Hello! Hope you can help me.
I'm making a memory experiment, in the encoding phase are two images that
should be classified as same or different.  In the recognition phase are two
images, one must decide which image is old or if both are new. The problem
is that in the recognition phase I want the program select randomly one of
the two images presented in the previous stage to be presented with a new
image. Use a slide with three objects, each corresponding to the three
options (old image 1, old image 2 and new image). I use this script to
select randomly the old image and the position (is only a part):


Set RImg1 =
CSlideImage(EstimulosR.States(EstimulosR.ActiveState).Objects("RIm1"))
Set RImg2 =
CSlideImage(EstimulosR.States(EstimulosR.ActiveState).Objects("RIm2"))
Set NImg =
CSlideImage(EstimulosR.States(EstimulosR.ActiveState).Objects("NIm"))

stims = c.GetAttrib("StimType") If stims = "1" Then stim = 1 Else stim = 2
End If

SelectPosition:
pos = PRNG.Random(1, 2)		'Select a position

SelectOld:
OldStim = PRNG.Random(1, 2)		'Select a old image

If pos = 1 And OldStim = 1 And stim = 1 Then
	pos1= pos1 + 1
	OldStim1 = OldStim1 + 1
	If pos1 > 10 Then
	GoTo SelectPosition
	If OldStim1 > 10 Then
	GoTo SelectOld
	Else
	'RImg1.Filename = c.GetAttrib("RImagen1")
	'RImg1.Draw
	RImg1.X = "441"
	RImg1.Y = "384"
	'NImg.Filename =c.GetAttrib("NImagen")
	'NImg.Draw
	NImg.X = "589"
	NImg.Y = "384"
	c.SetAttrib "Location", "1"
	c.SetAttrib "PosOld", "1"
	Debug.Print c.GetAttrib("PosOld")
    End If
	End If
End If


If pos = 2 And OldStim = 1 And stim = 1 Then
    pos2= pos2 + 1
    OldStim1 = OldStim1 + 1
	If pos2 > 10 Then
	GoTo SelectPosition
	If OldStim1 > 10 Then
	GoTo SelectOld
	Else
	'NImg.Filename =c.GetAttrib("NImagen")
	'NImg.Draw
	NImg.X = "441"
    NImg.Y = "384"
'	RImg1.Filename = c.GetAttrib("RImagen1")
	'RImg1.Draw
	RImg1.X = "589"
	RImg1.Y = "384"
	c.SetAttrib "Location", "2"
	c.SetAttrib "PosOld", "1"
	Debug.Print c.GetAttrib("PosOld")
	End If
End If
End If


The problem is that the script does not work, the program displays the three
images. I do not know how to make the program ignored the image should not
be presented.

Can anyone help me?

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

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