Staircase model and image naming on E-Prime

59 views
Skip to first unread message

Sean Gao

unread,
Jul 10, 2018, 4:20:45 PM7/10/18
to E-Prime
Hi everyone, 

I'm trying to create a staircase task on E-Prime, with a 2-down 1-up structure. The stimuli I'm using are striped circles with different orientations of stripes (tilted at different angles). I was wondering how I could call up an image by naming it with an integer and using a staircase? For example, would it be possible to set Image A as "1", Image B as "2", and Image C as "4", and then call up Images A and B or Image B then Image C using the differences between their numerical values?

Thanks!

David McFarlane

unread,
Jul 10, 2018, 4:56:11 PM7/10/18
to e-p...@googlegroups.com
File names are simply strings, so you may construct them however you
like. Using inline code (and assuming you properly use an attribute
reference to supply the file name to an E-Object), you could do
something like

c.SetAttrib "ImageFile", "Circle" & circleNumber & ".png"

where circleNumber is a variable where you have already calculated the
number using a staircase procedure or whatever. Note that if you need
to keep the value of circleNumber between different runs of the
Procedure, you will need to declare it as a global variable, see the
"Using E-Basic" chapter of the E-Prime User's Guide.

Note also that you may directly concatenate text & attribute references
within an attribute reference. E.g., suppose the attribute "Number"
resolves to the value 3, and "ImageType" resolves to the value "Nature".
Then, if you set the Filename property of an ImageDisplay object to
"[ImageType]-[Number].png", then it will call up a file named
"Nature-3.png". You can have all sorts of fun with this (even nested
attribute references, etc.)!

---------------
David McFarlane
E-Prime® 2.0 training online:
psychology.msu.edu/workshop-and-additional-course/e-prime-introduction-to-programming-computerized-behavioral-tasks
Twitter: @EPrimeMaster (twitter.com/EPrimeMaster)

Sean Gao

unread,
Jul 10, 2018, 5:59:12 PM7/10/18
to E-Prime
Thanks David, I'll try that out!
Reply all
Reply to author
Forward
0 new messages