File.ReadString

Top  Previous  Next

 

Syntax

function File.ReadLn(F: pointer; Count: integer): string

 

Alternative Names

ibec_fs_ReadString

 

Description

Reads up to Count characters from the given file-stream, and returns it as a string. The routine can read unicode text, see File.Open. Use File.ReadLn if you want to read lines of text instead of a fixed number of characters.

 

See also

File.Open
File.Close
File.EOF
File.ReadLn

 

Example

execute udsblock returns (valueout varchar(50))

as

begin

  /* open text file with UTF8 encoding preamble */ 

  fs = File.Open('c:\data\utf8text.txt', __fmOpenReadWrite + __fmShareDenyWrite);

  try

    /* read all available lines */

    while not File.EOF(fs)

    do begin

     valueout = File.ReadString(fs, 50);

         suspend; 

       end

  finally

    File.Close(fs);

  end

end