STRTOFILE( ) Function

See Also

Writes the contents of a character string to a file.

Syntax

STRTOFILE(cExpression, cFileName [, lAdditive])

Returns

Numeric

Arguments

cExpression

Specifies the character string that is written to the file. cExpression can be a literal character string, an expression that evaluates to a character string, or a character type variable, array element, or field.

cFileName

Specifies the name of the file to which the character string is written. Include a path with the file name if the file is in a directory other than the current default directory. If the file you specify does not exist, Visual FoxPro automatically creates it.

lAdditive

Specifies if the character string is appended to the end of the file. If lAdditive is true (.T.), the character string is appended to the end of the file.

If lAdditive is false (.F.) (the default), the file is overwritten with the character string. You are asked if you want to overwrite an existing file if SET SAFETY is set to ON. If SET SAFETY is set to OFF, the file is overwritten without warning.

Remarks

STRTOFILE( ) returns the number of bytes written to the file.