Hello All, A question relating to: First off, I am a non-programmer, noob, whatever. I am attempting to adapt a PEBL battery program (dspan.pbl) for my own experiment and am a little confused at variable declaration and passing of arguments in PEBL. Assume you are talking to a pre-K student about how computers work, and you'll be communicating on my level [?] Anyhow, I would sincerely appreciate any guidance that is shared...
What is currently burning a small hole in my brain is a function argument
that doesn't seem to relate to any declared variables elsewhere in the
program.
Below is a snippet of code that works, but I don't understand HOW it does
so. The problem for me in this user-defined function is the word
"stimpairs" - not defined anywhere else. How does the program "know" what
value is represented by this argument? Clearly it has been used as an
argument, processed, and then assigned to a new variable (like "stim",
"length", and "string" in the code below).
What gives???
Thanks for help and advice!
define Trial(stimpairs)
{
stim <- First(Transpose(stimpairs))
length <- Length(stimpairs)
string <- ListToString(stimpairs)
dummy <- Repeat("_",length)
responselist <- []
gStimLabel.text <- "Length " + length
Show(gStimLabel)
Draw()
if(gUseAudio)
{
PlayForeground(gReady)
}
Wait(800)
Hide(gStimLabel)
Draw()
Show(gStimLabel)
Wait(1000)
loop(x,stimpairs)
{
digit <- First(x)
sound <-Nth(x,2)
FilePrint_(gFileOut,digit)
gStimLabel.text <- digit
Draw()
t1 <- GetTime()
if(gUseAudio){PlayForeground(sound)}
t2 <- GetTime()
Wait(gISI - (t2-t1))
}
<<32A.png>>
------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________ Pebl-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pebl-list
