Click or drag to resize

FileToStr Function (String, Long)

X#
Returns the contents of a file as a character string.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION FileToStr(
	cFileName AS STRING,
	Flags AS LONG
) AS STRING
Request Example View Source

Parameters

cFileName
Type: String
Specifies the name of the file whose contents are returned as a character string. If the file is in a directory other than the current default directory, include a path with the file name.
Flags
Type: Long
Specifies if the file needs to be opened in Unicode mode or as Binary file. A value of S2F_FLAG_UNICODE_TEXT indicates that the file needs to be treated like a Unicode Text file. All other values indicate that the file needs to be treated like a binary file (just like in FoxPro).

Return Value

Type: String
Character
Remarks
Note that the size of the character string FileToStr( ) returns can be very large.
Examples
X#
1CD HOME()
2cRedist=FileToStr("REDIST.TXT")
3?OCCURS(".MSM",cRedist)
See Also