4D v16.3

EXPORT DIF

Home

 
4D v16.3
EXPORT DIF

EXPORT DIF 


 

EXPORT DIF ( {aTable ;} document ) 
Parameter Type   Description
aTable  Table in Table from which to export data,or Default table, if omitted
document  String in DIF document to receive the data

The EXPORT DIF command writes data from the records of the current selection of aTable in the current process. The data is written to document, a Windows or Macintosh DIF 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, you should 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.

By default, the command uses the UTF-8 character set. Since DIF format documents generally use the IBM437 character set, you may need to use the USE CHARACTER SET command to specify the appropriate character set.

When using EXPORT DIF, the default field delimiter is the tab character (code 9). The default record delimiter is the carriage return (code 13). You can modify these values by assigning new values to the two System Variables FldDelimit and RecDelimit. The user can change these default values in the export dialog box of the Design mode. Since Text fields can contain carriage returns, be careful if you use the carriage return as the field delimiter for fields to be exported.

Example  

The following example exports data to a DIF document. The method first sets the output form so that the data will be exported through the correct form, then performs the export:

 FORM SET OUTPUT([People];"Export")
 EXPORT DIF([People];"NewPeople.dif"")  ` Export to the "NewPeople.dif" document

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



See also 

EXPORT SYLK
EXPORT TEXT
IMPORT DIF
USE CHARACTER SET

 
PROPERTIES 

Product: 4D
Theme: Import and Export
Number: 84

The OK variable is changed by the commandThe Unicode mode affects this command

 
HISTORY 

Created: < 4D v6

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)