Function MemoWrit() Foundation

Writes a character string or a memo field into a file.

Syntax
MemoWrit( <cFilename>, <cString> ) --> lSuccess
Parameters
<cFileName>
<cFilename> is a character string containing the name of a file (including the drive and path if necessary).
<cString>
<cString> is a character string or a memo field written into the file <cFilename>.
Return

If MemoWrit() could successfully write the text <cString> into the file, the function returns the value .T. (true). Otherwise, the return value is .F. (false).

Description

The memo function MemoWrit() writes a character string into a file. It is the counterpart of MemoRead() which reads files. When the path is not specified in <cFilename>, MemoWrit() writes the file into the current directory. MemoWrite() ignores the setting of SET DEFAULT to determine the path. If the file <cFilename> already exists, it is overwritten without warning.

Examples
MemoWrit()
// In this example, the functions MemoRead(), MemoWrit(), 
// and MemoEdit() are used to program a short user-defined 
// function for a simple text file editor. 

PROCEDURE Main 

   ? TextEditor( "Test.txt" ) 

RETURN 

FUNCTION TextEditor( cFilename ) 
RETURN MemoWrit( cFilename, MemoEdit( MemoRead( cFilename ) ) ) 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.