> When I have different directories which contain text files, and I have
> to open each file and read only the first line of it, which one will be
> faster and more efficient:
> 
> FOR
>       OPEN
>               read first line
>       CLOSE
>       list.Add
> NEXT
> 
> or
> 
> FOR
>       File.Load(...)
>       Split(... chr$(10))
>       list.Add(...)
> NEXT
> 
> Or wouldn't that be feasible in case of, say, 50 - 70 files in such
> directories?
> 
> Thanks for your comments :-)
> 
> Rolf
>

The second one is obviously faster. Just check the execution time!

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to