EXPORT TEXT

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


EXPORT TEXT ({table; }document)

ParameterTypeDescription
tableTableTable from which to export data, or
Default table, if omitted
documentStringText document to receive the data

Description

The EXPORT TEXT command writes data from the records of the current selection of table in the current process. The data is written to document, a Windows or Macintosh text document on the disk.

The export operation is performed through the current output form. The export operation writes fields and variables based on the entry order of the output form. For this reason, use an output form that contains only the fields or enterable objects that you wish to export. Do not place buttons or other extraneous objects on the export form. Subform objects are ignored.

An On Load event is sent to the form method for each record that is exported. Use this event to set the variables you may use in the export form.

The document parameter can name a new or existing document. If document is given the same name as an existing document, the existing document is overwritten. The document can include a path that contains volume and folder names. If you pass an empty string, the standard Save File dialog box is displayed. If the user cancels this dialog, the export operation is canceled, and the OK system variable is set to 0.

A progress thermometer is displayed during export. The user can cancel the operation by clicking a Stop button. If the export is successfully completed, the OK system variable is set to 1. If the operation is canceled or an error occurs, the OK system variable is set to 0. The thermometer can be hidden with the MESSAGES OFF command.

The export operation is made using the default ASCII map for the platform on which it is executed, unless you change the ASCII map (using the command USE ASCII MAP) prior to the export. An ASCII map can be used to convert the data for use on other platforms that have a different ASCII table.

Using EXPORT TEXT, the default field delimiter is the tab character (ASCII 9). The default record delimiter is the carriage return character (ASCII 13). You can change these defaults by assigning values to the two delimiter system variables: FldDelimit and RecDelimit. The user can change the

defaults in the User environment Export Data dialog box. Text fields may contain carriage returns, so be careful when using a carriage return as a delimiter if you are exporting text fields.

Example

This example exports data to a text document. The method first sets the output form so that the data will be exported through the correct form, changes the 4D delimiter variables, then performs the export:

   OUTPUT FORM([People];"Export")
   FldDelimit:=27 ` Set field delimiter to Escape character
   RecDelimit:=10 ` Set record delimiter to Line Feed character
   EXPORT TEXT([People];"NewPeople") ` Export to the "NewPeople" document

See Also

EXPORT DIF, EXPORT SYLK, IMPORT TEXT, USE ASCII MAP.

System Variables and Sets

OK is set to 1 if the export is successfully completed; otherwise, it is set to 0.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next