|
|
|
|
|
- Importing a Text Memo item
- Importing a Binary Memo item
- Importing an indexed item
- Importing a Time item
- Previous versions
HImportText (Function) In french: HImporteTexte
Not available with this kind of connection
Imports a Text file into a data file in HFSQL Classic or Client/Server format (data file described in the data model editor, or declared by HDeclare, HDeclareExternal or HDescribeFile). Remark: If the HFSQL data file used does not physically exist, it will be automatically created.
IF HImportText("CLIENT","C:\UnExemple\Client.txt", "NOM,ADRESSE,LOGO", hDefaultVal, "Jauge1") = False THEN
Error("Importation impossible")
ELSE
END
sCheminFichierTexte is string = "ImportJoueur.txt"
IF HImportText(Joueur, sCheminFichierTexte, "sNomJoueur,dDateNaissance", ...
"," + Charact(127) + """" + Charact(127) + CR + Charact(127) + ".") THEN
...
ELSE
...
END
Syntax
<Result> = HImportText(<Data file> , <Full path of text file> , <List of items> , <Separators> [, <Options> [, <Progress Bar>]])
<Result>: Boolean - True if the operation was performed,
- False if an error occurred. HError returns more details about the problem.
<Data file>: Character string Name of the HFSQL data file into which the import must be performed. <Full path of text file>: Character string Full access path to text file to import. <List of items>: Character string List of item names in the text file. The names can be delimited by single quotes and they are separated by commas or CR characters. The names of composite key items are ignored.If this parameter is not specified or corresponds to an empty string (""), all items are imported (except compound keys) in the order in which they were created in the physical file. <Separators>: Character string List of separators used for columns, strings, rows and decimal places. The different separators are separated by Charact(127) (for backward compatibility with WINDEV 5.5). <Séparateur de colonnes> + Caract(127) + <Séparateur de chaînes> + Caract(127) + <Séparateur de lignes> + Caract(127) +<Séparateur de décimales> - <Column separator>: Character string (", " by default).
- <String separator>: Character (" by default)
- <Row separator>: Character string (CR by default, which means Charact(13)+Charact(10))
- <Decimal separator>: Character ("." or "," by default)
<Options>: Optional Integer constant (or combination of constants) Configures the type of import to perform: | | hCopyAutoID | The automatic identifier is copied. It is not recalculated. | hImpCreation | If the import data file exists, it is overwritten. | hImpIgnoreFirstLine | The first row of the imported file is ignored. | hImpIgnoreInvalidLine | The lines whose structure are invalid are not imported: the import continues on the following lines. The structure is invalid if data is missing for one or more items, or if string separators are missing. | hImpIgnoreEmptyItem | If one or more items are not filled in the text file, the corresponding lines are still imported. The missing items contain:- the default value of items if the hDefaultVal constant is specified.
- the value of items in the current record before the call to HImportText.
| hImpBreakable | The import can be interrupted by pressing the Esc key (parameter ignored on the data files in 5.5 format). If the import is interrupted, the imported records are kept in the data file. A re-index operation is automatically performed if necessary (cannot be interrupted). | hImpNormal (default value) | If the import data file already exists, it is filled with the imported data ; otherwise, the data file is created. No management of integrity and no management of duplicates. The non-imported items take the value of the current record. The string delimiters are used. The automatic identifiers are recalculated.
| hImpOEM2ANSI | The imported strings are automatically converted from OEM to ANSI. | hImpNoDelimiter | The string separators (if they exist) are part of the item. | hImpTestDuplicates | Enables the management of duplicates on unique keys during the import (the management of duplicates is enabled on unique keys only and not on the entire record).
| hImpTestIntegrity | Checks the integrity during the import.
| hDefaultVal | For the non-imported items, the values of the current record are reinitialized:- with their default value if the hDefaultVal constant is specified.
- with the value of the corresponding items in the current record before the call to HImportText if the hDefaultVal constant is not specified.
|
<Progress Bar>: Optional control name or window name - Name of the window in which the progress bar will be displayed,
- Name of the Progress Bar control.
Business / UI classification: Business Logic
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|