|
|
|
|
|
- Importing a Text Memo item
- Importing a Binary Memo item
- Importing an indexed item
- Importing a Time item
<Source>.ImportText (Function) In french: <Source>.ImporteTexte
Not available with this kind of connection
Imports a Text file into an HFSQL Classic or Client/Server data file. This data file must have been defined in the data model editor, or declared with <Source>.Declare, <Source>.DeclareExternal or <Source>.DescribeFile). Note: If the HFSQL data file used does not physically exist, it will be automatically created.
IF Customer.ImportText("C:\AnExample\Customer.txt", "NAME,ADDRESS,LOGO", hDefaultVal, "ProgressBar1") = False THEN
Error("Unable to import")
ELSE
END
sPathTextFile is string = "ImportPlayer.txt"
IF Player.ImportText(sPathTextFile, "sPlayerName,dDateOfBirth", ...
"," + Charact(127) + """" + Charact(127) + CR + Charact(127) + ".") THEN
...
ELSE
...
END
Syntax
<Result> = <Source>.ImportText(<Full path of text file> , <List of items> , <Separators> [, <Options> [, <Progress Bar>]])
<Result>: Boolean - True if the operation was performed,
- False if an error occurs. HError returns more details about the problem.
<Source>: Type corresponding to the specified source Name of the HFSQL data file to import into. <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. Names can be delimited by single quotes and are separated by commas or CR characters. "Composite key" item names are ignored.If this parameter is not specified or is 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 various separators are separated by the character character(127) (for compatibility with WINDEV 5.5).. <Column separator> + Charact(127) + <String separator> + Charact(127) + <Row separator> + Charact(127) +<Decimal separator> - <Column separator>: String ("," by default).
- <String separator>: Character (" by default)
- <Row separator>: String (CR by default, i.e., 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 data file to import into exists, it will be overwritten. | hImpIgnoreFirstLine | The first line of the imported file is ignored. | hImpIgnoreInvalidLine | Import ignores lines with an invalid structure. 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 populated in the text file, the corresponding lines are still imported. The missing items contain:- the default value of the items if the hDefaultVal constant is specified.
- the value of the items in the current record before calling <Source>.ImportText.
| hImpBreakable | Import can be interrupted by pressing the Esc key (parameter ignored on 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 data file to import into already exists, it is populated with the imported data; otherwise, the data file is created. Data integrity and duplicates are not checked. Non-imported items take the value of the current record. String delimiters are used. Automatic identifiers are recalculated.
| hImpOEM2ANSI | Imported strings are automatically converted from OEM to ANSI. | hImpNoDelimiter | String separators, if any, are part of the item. | hImpTestDuplicates | Checks for duplicate values on unique keys during an import operation (enabled only on unique keys, not on the entire record).
| hImpTestIntegrity | Checks data integrity during an import operation.
| hDefaultVal | For 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 calling <Source>.ImportText, 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|