This function import an application into a database. Generalizes an older function Import_appl_ex (unusable in version 9). The import properties are described in the ipar structure:
Folder | Meaning |
cbSize | size of the t_import_param structure in bytes |
hParent | parent window for possible dialogs (unused since version 9) |
flags | import flags |
file_name | full path to the definition file of the application (.apl extension file); if nil, the function will display a dialog for selecting file |
alternate_name | name of the application after renaming |
report_progress | if TRUE, callback will be called |
callback | procedure, that will be called for each exported object, or nil. |
param | optional parameter passed to the callback function |
flags parameter values:
IMPAPPL_NEW_INST | 1 |
IMPAPPL_USE_ALT_NAME | 2 |
IMPAPPL_REPLACE | 4 |
The flags parameter value have meaning only if the imported application already exists. If the imported application exists and neither of the flags IMPAPPL_NEW_INST and IMPAPPL_REPLACE is set, an error will occur (ERROR_IN_FUNCTION_ARG (180)). If the IMPAPPL_REPLACE flag is set, the original application will be replaced with the new one. If the IMPAPPL_NEW_INST flag is set, a new application will be created. If the IMPAPPL_USE_ALT_NAME flag is set, the alternate_name name will be used,otherwise an automatically created name derived from the original application name will be used.
The report_progress item specifies, whether the import progress should be displayed. If callback = nil, then the export progress will be displayed in the standard 602SQL dialog. If the callback value is a pointer to a procedure of the following type:
procedure CallBack(Categ : Integer; Value : PChar; Param : Pointer ); stdcall; void CallBack( int Categ, char * Value, void * Param );
the application may inform about the export progress using its own resources. The Categ argument specifies the type of status information, the Value argument its value and the Param argument is a copy of the param item from the t_import_param structure. If the procedure is specified, it will be called each time a object is imported by the Import_appl_param function and in some other situations:
Categ | Value | Description |
IMPEXP_PROGMAX | object count | Called on the beginning of the import, the Value value sets the count of all objects in the application (as Integer). Allows e.g. setting the Max property on ProgressBar |
CATEG_... | object category | Called for each object, returns the category and the name of exported object |
IMPEXP_FILENAME | see description | If called after calling IMPEXP_PROGMAX, Value is the name of the APL file. If called after calling the CATEG_..., Value is the name of the file with the exported object |
IMPEXP_PROGPOS | N/A | Called after a object is imported. Allows e.g. moving the ProgressBar one step ahead (Value not available) |
IMPEXP_ERROR | error description | The error message about the cause of object export failure or the result of importing the whole application |
IMPEXP_STATUS | final information about the export success or failure | End of the import |
The t_import_param structure definition and the possible procedure from the callback parameter can be found in the definition files for the various programming languages.
TRUE if successful, FALSE otherwise.