Yet Another Question: populating lists from files

Paul Gr pauls_postbus at hotmail.com
Fri Jan 7 16:47:40 UTC 2005


Hi Todd,

here is an example code snippet, which fills a list object from an external
file. You should set the filename variable (strFilename) before this code
and insert it as an inline object at the beginning of your experiment.

' load stimulus definitions, or use embedded defaults
If Len(strStimuliDefinitionFile)>0 then
	Debug.Print "Loading stimuli definitions file: " & strStimuliDefinitionFile
	lstStimuli.LoadMethod = ebLoadMethodFile
	lstStimuli.Filename = strStimuliDefinitionFile
	lstStimuli.Load
	lstStimuli.Reset
End If


Note that EPrime is very sensitive about the format and contents of the
external file. The first line should contain the attribute names. Including
Weight, Nested and Procedure. All names and values should be separated by a
tab character, not spaces. Also, prevent extra tabs and spaces at the end of
the lines, and empty lines at the end of the file.

cheers,
Paul Groot. Vrije Universiteit Amsterdam

>From: Todd Thompson <twthompson at gmail.com>
>Reply-To: toddt at alumni.rice.edu
>To: "eprime at mail.talkbank.org" <eprime at mail.talkbank.org>
>Subject: Yet Another Question: populating lists from files
>Date: Thu, 6 Jan 2005 16:17:57 -0800
>
>Sorry to deluge the mailing list, but I have one more hopefully simple
>ePrime question:
>
>I want to run the same experiment six times, changing the stimuli with
>each run. I'd like to populate my lists from one of the six input
>files dynamically, depending on the run number.
>
>Is this possible? Here are the things I tried that didn't work:
>1) I set the list load method to File, then put a variable "[var]" in
>the list filename field -- this gave an error message saying
>"reference to attribute not permitted"
>2) I left the list load method as embedded in the GUI, then created an
>inline block of code that looked like this:
>PassiveTrials.loadmethod = ebLoadMethodFile
>PassiveTrials.filename = "PassiveBlock1.txt"
>PassiveTrials.load
>This ran my embedded list and ignored my attempts to load a new list.
>
>I know I can solve this problem other ways (via nested lists, for
>example), but I like being able to generate/maintain my stimuli
>externally, if I'm working on a computer without ePrime installed.
>
>Sorry if this is an overly simple question. I'm finding the ePrime
>help files and documentation somewhat inadequate...
>
>Thanks for any help,
>Todd
>
>----
>Todd Thompson
>Helen Wills Neuroscience Institute
>University of California, Berkeley
>

_________________________________________________________________
MSN Webmessenger: altijd en overal beschikbaar http://webmessenger.msn.com/



More information about the Eprime mailing list