How many samples in a List object?

EJ Nikelski nikelski at bic.mni.mcgill.ca
Sun Nov 12 19:30:09 UTC 2006


Hi Paul,

    Thanks for the info. I discovered the info in E-basic Help once 
before, and then promptly forgot about where I had seen it. I looked at 
the help and tried a few things, and now have a better understanding of 
how to loop through a List object. In brief (for the benefit of the 
list), we are dealing with 2 properties:

(1) List.Order.Count
     Prior to executing a List object, this will return the total number 
of entries (aka trials, for example) contained within the List. Thus, a 
List containing 10 levels, each with a Weight of 2, will return 20. Upon 
entering the List, this value returns the number of trials remaining.

(2) List.Size
     This returns the number of levels in a List, and does not change 
during List processing. So, this is the one to use when looping through 
all of the levels within a List.

Lots of fun. Yes?

Sincerely,

-Jim



Paul Gr wrote:
> Hi Jim,
> 
> There is some info available about this topic in the EBasic help 
> document (the List object is a good starting point.) However, EPrime is 
> a bit picky about editing the contents of a List (or FactorSpace) object 
> at runtime, so perhaps you should choose a different approach before 
> even trying this. (Assuming you would like to implement some 
> non-straightforward modifications.) However, there are some pieces of 
> example code that should work:
> 
> 
> ‘ (piece of code copied from List.GetAttrib description)
>  Dim i As Integer
>  For i = 1 To List1.Order.Count
>     Debug.Print "The Stimulus for level " & i & " is " &_
>     List1.GetAttrib(i, "Stimulus")
>  Next i
> 
> 
> best,
> paul
> 
> 
> 
> 
> 
>> From: EJ Nikelski <nikelski at bic.mni.mcgill.ca>
>> To: eprime at mail.talkbank.org
>> Subject: How many samples in a List object?
>> Date: Mon, 06 Nov 2006 15:20:25 -0500
>>
>> Hello List,
>>
>>    I have a brief question that has me stumped. When writing inline 
>> code, to, say, loop through all entries in a list, how can I tell how 
>> many entries (samples) are in the list? I've tried ListName.Samples, 
>> and a number of GetAttr possibilities, but have yet to stumble upon 
>> the answer. If anyone knows the answer (and where it might be in the 
>> documentation), I'd be a very happy camper. Thanks in advance.
>>
>> -Jim
>>
>>
>>
>> -- 
>> Jim Nikelski, Ph.D.
>> Postdoctoral Research Fellow
>> Bloomfield Centre for Research in Aging
>> Lady Davis Institute for Medical Research
>> Sir Mortimer B. Davis - Jewish General Hospital
>> McGill University
>> Tel: (514) 340-8222 x 2298
>> Fax: (514) 340-8295
>>
> 
> _________________________________________________________________
> Gratis virusbescherming terwijl je zoekt! http://toolbar.live.com/
> 
> 
> 



More information about the Eprime mailing list