[DUG] File handling help in Delphi 5

Neven MacEwan neven at mwk.co.nz
Thu Dec 6 12:41:41 NZDT 2007


Vikas

These are very "old" routines that date back to Pascal, look at TStrings 
(as suggested) and Streams

HTH
Neven


>
> Hi
>  
> I am back again. Well i need one help in file handling. May be i sound 
> dump here but i struck up badly at one point here. Ok let me first 
> explain my first situation.
>  
> I have say 10 files and path is say c:\vikas\file1text    upto  
> c:\vikas\file10.text. I am storyng all this in string list 
>  
> ok Here is my sample code
> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
> setlength(Ltextfile, (Ftextfilelists.Count));
> for L1 := 0 to Ftextfilelists.Count-1 do
>     begin
>       AssignFile(Ltextfile[l1],Ftextfilelists[l1]);
>       reset(Ltextfile[l1]);
>
>       while not Eof(Ltextfile[l1]) do
>       begin
>         Readln(Ltextfile[l1]);
>         while not Eof(Ltextfile[l1]) do
>         begin
>           Readln(Ltextfile[l1],Lbuff);
>
>          Do something
>
>         end;-
>
> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
>
> heere ftextfilelists is a string list , ltextfile is an dynamic array 
> of textfile
>
> Ok my problem here is in Lbuff as u can see i am storing the file 
> information say file1.txt content and inside this file i have say 20 
> rows of information
>
> like this
>
> (***********************************************************************************
>
> 1 a vb ssss sdsdadadasdas asdadadasdasd asdadasdasdasdasd
>
> 2 aldkasdk;asdk;alskd;aslkd;alkd;alkd;aslkd;askd;askd;alkd;askd
>
> 3 asldkas;dk;asdka;sdk;alsdk;alsdk;aslkd;alskd;alskd;alskd;laskd
>
>  
>
> ***********************************************************************************}
>
> Now the problem is the above code takes the value from 2 instead of 1 
> it ignores the first row of information and this si what confusing me
>
> I may be sound stupid here but i will apreciate if anyone suggest me 
> something wrong in my above code logic
>
> Thanks
>
> Vikas
>
>  
>
>  
>
>  
>
>
> -- 
>   vikas
> ------------------------------------------------------------------------
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject: unsubscribe



More information about the Delphi mailing list