Previous Next

Reads a complete file in text mode. Returns a sequence of human-readable characters.

The file is identified either by referring to an alias (Syntax 1) or by supplying a filepath (Syntax 2).


Syntax 1

SELECT   alias 
alias  :=  USFile.string

The required alias must be the alias that was associated with the file to be read when the file was opened by calling the USFile.Open method.

Alias in this syntax must be preceded by the prefix "USFile." This prefix is case-insensitive and ends in a full stop. Like the prefix, string is case-insensitive.

For more details, see the "Calling USFile.ReadTextFile with an alias" section below.


Syntax 2

INVOKE  USFile.ReadTextFile WITH
SELECT  filepath

The required filepath is the name of the file to read. This name is allowed to contain environment variables.

Filepath is not allowed to contain a full stop. If it contains a full stop, the call is interpreted as in Syntax 1 above.

For more details, see the "Calling USFile.ReadTextFile with a filepath" section below.



INVOKE   USFile.ReadTextFile WITH
SELECT   'USFile.MyOverview'

UPDATE   tours_backup
SET      tours_pdf = USFile.ReadTextFile( 'USFile.MyOverview' )
WHERE    id = 1

UPDATE   tours_backup
SET      tours_pdf = USFile.ReadTextFile( '%TEMP%\ToursOverviewFile.pdf' )
WHERE    id = 1


collapseCalling USFile.ReadTextFile with an alias
collapseCalling USFile.ReadTextFile with a filepath



See also



USFile internal component