www.icetips.com  Icetips Utilities Documentation 7/6/2014    

String Class:  ReadFileToString

Previous  Top  Next  


Prototype: (String pFileName),LONG,PROC

 

pFileNameFilename to read

 

ReturnsNumber of bytes read.

 

This is a very powerful method that uses API to read a file into a dynamic string containing the entire file.  The file is read into a single buffer so the reading is extremely fast.  While this is primarily designed for text files, this method could be used to read just about any kind of file.  Once the file is read the contents is stored in the FileString property where you can manipulate it.  Because of this you need to make sure that you do not have important data in the FileString property before you call this method.

 

Example:

ITS  ITStringClass

Code

ITS.ReadFileToString('c:\temp\test.txt')

!! You can now access the contents of test.txt by using the ITS.FileString property.

 

See also:

FileString

WriteStringToFile

WriteQToFile

AllocateFileString

DisposeFileString



Direct link to this page: http://www.icetips.com/manuals/utilities/readfiletostring_stringclass.htm