4D v16.3IMPORT DATA |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
IMPORT DATA
IMPORT DATA
The IMPORT DATA command imports the data located in the fileName file. 4D can import the data in the following formats: Text, Fixed length text, XML, SYLK, DIF, DBF (dBase), and 4D. If you pass an empty string to fileName, IMPORT DATA displays the standard save file dialog box, allowing the user to define the name, type, and location of the import 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 set to 0. The optional project parameter lets you use a project to import data. When you pass this parameter, the import is carried out directly, without any user intervention (unless you use the * option, see below). If you don’t pass this parameter, the import dialog box is displayed. The user can define the import parameters or load an existing import project. An import project contains all the import parameters such as the tables and fields in which to import, the delimiters to use, and so on. 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 import dialog box.In the latter case, you have two solutions available:
Compatibility note: Beginning with version 12 of 4D, import projects are encoded in XML. 4D can open import 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 import files. The optional * parameter, if it is specified, forces the display of the import dialog box with the import parameters set as they were 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 import dialog box, the parameters of the “new” project. You can then store the new project in a BLOB field, on disk, and so on. If the import was successful, the OK system variable is set to 1. Note: Refer to the EXPORT DATA command for an example concerning the definition of an empty project. If the user clicks Cancel in the standard save file dialog box or in the import dialog box, the OK system variable is set to 0. If the import was successful, the OK system variable is set to 1.
See also
|
PROPERTIES
Product: 4D HISTORY
Modified: 4D 2003 ARTICLE USAGE
4D Language Reference ( 4D v16) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||