Exec.ToFile
Description
- Writes a single line of text to a log file, including a line break at the end.
Syntax
Parameters
- fpath
- (string) path to the target file
-
Possible Values
- a file path
-
- "log"
- The currently open log file, as specified by an Exec.LogKeys() call.
- text
- (string) the text to write to the file
Examples
- Exec.ToFile(?"c:\web\out.txt", "some text to write")
- Exec.ToFile(?"c:\web\out.txt", date++":"++time)
Notes
- Be aware that Exec.ToFile() will only write a single line of text -- and that means no line breaks within that string, either. (That will draw errors, too, if the string begins with a line break.)
See Also
- Use the File plugin for file input and output with multi-lined strings. For more information, see:
- PPSR > Plugins > The Plugins > File
- the second example in Exec.LogKeys in this same section