Tech Tip: Extensions and EXPORT TEXT
PRODUCT: 4D | VERSION: 6.5 | PLATFORM: Win
Published On: March 9, 2001
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")