4D v13.4EXPORT DATA |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
EXPORT DATA
EXPORT DATA
The EXPORT DATA command exports data in the fileName file.4D can export data in the following formats: Text, Fixed length text, XML, SYLK, DIF, DBF (dBase), and 4D. If you pass an empty string in fileName, EXPORT DATA displays the standard save file dialog box, allowing the user to define the name, type, and location of the export file. Once the dialog box has been accepted, the Document system variable contains the access path and the name of the file. If the user clicks Cancel, the execution of the command is stopped and the OK system variable is equal to 0. The optional project parameter lets you use a project to export data. When you pass this parameter, the export is carried out directly, without any user intervention (unless you use the * option, see below). If you don’t pass this parameter, the export dialog box is displayed. The user can define the export parameters or load an existing export project. An export project contains all the export parameters such as the tables and fields to export, delimiters, etc. In the project parameter, you can pass either a Text variable containing XML or a Text variable containing a reference to a pre-existing DOM element, or a BLOB. Projects may have been created by programming (XML format projects only) or by loading parameters that were previously defined in the export dialog box.In the latter case, you have two solutions available:
Compatibility note: Beginning with version 12 of 4D, export projects are encoded in XML. 4D can open export projects generated with previous 4D versions (BLOB format) but any projects created starting with v12 can no longer be opened with v11 or earlier versions. We now recommend that you use Text variables for handling export files. The optional parameter *, if it is specified, forces the display of the export dialog box with the parameters defined in project. This feature allows you to use a predefined project, while still having the possibility to modify one or more of the parameters. Furthermore, the project parameter contains, after closing the export dialog box, the parameters of the “new” project. You can then store the new project in a Text field, on disk, etc. If the export was successful, the OK system variable is set to 1. This example illustrates the use of the EXPORT DATA command to export data in binary format.
C_TEXT($ExportPath)
C_POINTER($1) //table This example creates an empty project and stores the parameters set by the user in the export dialog box there: C_TEXT($exportParams) If the user clicks Cancel in the standard open file dialog box or in the export dialog box, the OK system variable is equal to 0. If the export was successful, the OK system variable is equal to 1. |
PROPERTIES
Product: 4D
INDEX HISTORY
Modified: 4D 2003 SEE ALSO
EXPORT DIF |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||