List.AddLevel returns 'Error -999' Level name that is an integer with level count mismatch

Rob Manchester robmanc2014 at gmail.com
Wed Aug 6 15:42:41 UTC 2014


Hi

I'm a newbie to E-Prime and I'm using a program that someone else has 
written that has used code rather than the GUI for some aspects of the 
program.

In the program there is a list 'triallist' which has 2 levels as standard. 
However there is some in line code which creates a new level for each trial 
over and above these first two levels (I don't know why it is written this 
way). The section of the code causing the error is shown below:



For i=1 To nTrials                       'note: ntrials is set as 72 in a 
separate inline piece of code - this specifies the number of trials in the 
block.
    If i>2 Then
        trialList.AddLevel i              'ERROR OCCURS HERE
    End If
    trialList.SetWeight i, "1"

     k=goodList(i)

    trialList.SetAttrib i, "picture", "resources\\" & picToShowList(k)    
    'blockList.GetAttrib(nBlockID,"picture1")
    trialList.SetAttrib i, "picType", picToShowTypeList(k)

    If ifReward(i) Mod 2 =1 Then
        trialList.SetProc i, "rewaShow"
        trialList.SetAttrib i, "ifReward", "1"
    Else
        trialList.SetProc i, "noneShow"
        trialList.SetAttrib i, "ifReward", "0"
    End If
Next i

Set trialList.TerminateCondition = Cycles(1)
Set trialList.ResetCondition = Samples(nTrials)
trialList.Reset


print #9, nBlockID, fName(reShowPicList.GetAttrib(1,"reShowName1")), 
fName(reShowPicList.GetAttrib(1,"reShowName2"))
print #9, " "

Set reShowPicList.TerminateCondition = Cycles(1)
Set reShowPicList.ResetCondition = Samples(2)

reShowPicList.Reset



The error is 'Error -999' Level name that is an integer with level count 
mismatch

The code runs for each block (i.e. it specifies the trials for each block). 
For the first block it runs fine. Then for the second block it produces an 
error when i = 3. I used a debug print to get the value of trialList.size 
and found that it was equal to the ntrials value (i.e. the number of trials 
that occurs in the first block). This I assume means that the temporary 
levels added in the first block haven't been removed, thus causing the 
error on the second block. I assume the trialList.reset line near the 
bottom is supposed to do this. Any ideas what might be going wrong?

I'm using Version 2, weirdly I'm sure this code works on version 1!

Thanks
Rob

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/9d9af65c-7771-4f57-967f-0242d039244e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20140806/bf9cffb1/attachment.htm>


More information about the Eprime mailing list