KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Writing text directly to a disk file
PRODUCT: 4D | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: March 21, 2014
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Prior to v14, an approach to writing to a file would be to use the SEND PACKET command from the DocRef created by OPEN DOCUMENT, CREATE DOCUMENT, or APPEND DOCUMENT. To ensure that the data is saved to the disk, CLOSE DOCUMENT must be called.

In v14, the command TEXT TO DOCUMENT allows writing text directly to the disk. By using the CREATE DOCUMENT and CLOSE DOCUMENT, the file is created on the disk. Using TEXT TO DOCUMENT does not use the DocRef to write to the document but directly to the text file name. Also, data being written to the file has an option to use different modes of line breaks.

See Also: