KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Extensions and EXPORT TEXT
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Win
Published On: March 9, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In version 6.0.x EXPORT TEXT would allow you to save a filename with an extension. For example, the following statement would save the contents of the export in a file named "test.htm":

EXPORT TEXT([Table 1];"test.htm")

If you use that same statement in 6.5.x or 6.7.x you will get a file named "test.txt", because 4D now assumes you are exporting to text format and sets the extension to ".txt", no matter what extension is specified in the filename variable.

To work around this problem, you can use the SET DOCUMENT TYPE command. For example, the following code would create a "test.txt" file and reassigns its extension to ".htm".

EXPORT TEXT([Table 1];"test.txt")
SET DOCUMENT TYPE("test.txt";"html")