Board index » delphi » Need help with Text files, and File Records

Need help with Text files, and File Records

Is there a way that I can store a textfile in a record?  I need to be
able to store a textfile of undetermined size (by undetermined, I mean
the text file could be any size) into a record field.  I don't even know
how to begin.  something like this:

type
  MyTextFile = record
    Text_file : Textfile;
 end;

var
  MyFile : MYTextFile;
  F : file of MYTextFile;

and so on.

any help would be greatly appreciated
Mike

Please reply by e-mail if possible

--
 -- Everyone has desires to see what lies behind locked doors...
    Censorship suckS!
    Graphic Illusions - http://www.netcom.com/~g-illus

 

Re:Need help with Text files, and File Records


In article 7...@ix.netcom.com, Mike <g-il...@ix.netcom.com> writes:

Quote
>Is there a way that I can store a textfile in a record?  I need to be
>able to store a textfile of undetermined size (by undetermined, I mean
>the text file could be any size) into a record field.  I don't even know
>how to begin.  something like this:

>type
>  MyTextFile = record
>    Text_file : Textfile;
> end;

>var
>  MyFile : MYTextFile;
>  F : file of MYTextFile;

>and so on.

This would allow a new file in each record, but only stores the file 'Handle' not its
contents. Since you may be limited in the number of handles, depending on  how
many records you have, you may want to store a pointer to a block of memory
that contains the textfile contents. You can then use one handle to read in the
info.

However, trying to save these records may be more complicated, but you
may get some mileage from  Streams.

HTH

Ray Cramer
R...@Pol.ac.uk

Other Threads