Loading External Files Into A List - Proper Set-up

Patrick ptarth at gmail.com
Fri Apr 20 03:15:36 UTC 2012


Apparently I was too hasty in my response.
List.Reset does not entirely fix the issue, the Termination.Condition must 
also be reset. (As per another post by David)
 
Thus the entire fix would be:
 
List1.LoadMethod = ebLoadMethodFile
List1.Filename = "lists/" & c.GetAttrib("ExpList") & ".txt"  'Load a 
filename. This just happens to be the one I used.
List1.Load 
List1.Reset
Set List1.TerminateCondition = Cycles(1) 
Set List1.ResetCondition = Samples(List1.Deletion.Count) 
 

On Friday, April 20, 2012 2:26:09 PM UTC+12, Patrick wrote:

> I'm resurrecting an ancient thread, because a problem emerged when I 
> followed its instructions. Because I had a difficulty with the ideas 
> presented, I'm assuming that sometime in the future someone else may have 
> the issue and I can spare them the grief.
>  
> (XKCD (as usual) provides some amusing interpretation of the situation 
> http://xkcd.com/979/)
>  
> In regards to loading a list from text file this information was provided.
>  
> On Thursday, January 14, 2010 12:15:34 AM UTC+13, liwenna wrote:
>
>> .... 
>>
>> For the die-hard coders among us you could/should insert a
>> listname.reset either somewhere AFTER the list has run or at the total
>> beginning of the above code, before it loads the .txt file into the
>> list. ...
>>
>> I had loaded an example scripted in a Eprime List Object, which could be 
> a different size than some of the alternative lists. I followed these 
> instructions (and because I didn't think everything through) placed the 
> List.Reset BEFORE the loading code. This gave me a very unexpected and 
> nonobvious error. At a cursory test everything worked correctly, but it 
> there was a hidden problem. The problem was that the characteristics of the 
> original list was still present and were overwriting infromation about 
> the the new List. Examples to clarify the behavior.
>  
> Problem Free Example
> ListX is a List Object referencing List1 (size = 100 lines)
> In an inline Object i replace ListX with List2 (size = 100 lines)
> When I run ListX, it has 100 samples. All 100 are from List2. (Everything 
> is fine)
>  
>  Too Short Example
> ListX is a List Object referencing List1 (size = 100 lines)
> In an inline Object i replace ListX with List3 (size = 80 lines)
> When I run ListX, it has 100 samples. 80 from List3 and the last 20 lines 
> from List1.
>  
> Too Long Example
> ListX is a List Object referencing List1 (size = 100 lines)
> In an inline Object i replace ListX with List2 (size = 120 lines)
> When I run ListX, it has 100 samples. The last 20 lines from List2 are 
> absent from the list.
>  
> To solve this problem the List.Reset must occur AFTER the List.Load 
> statement.
>  
> Cheers,
> Pt
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/pNImxYLBUKoJ.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120419/565bece0/attachment.htm>


More information about the Eprime mailing list