Click or drag to resize

DbAppDelim Function

Import records from a delimited text file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION DbAppDelim(
	 cSourceFile AS USUAL,
	 cDelim AS USUAL,
	 acFields AS USUAL,
	 cbForCondition AS USUAL,
	 cbWhileCondition AS USUAL,
	 nNext AS USUAL,
	 nRecord AS USUAL,
	 lRest AS USUAL,
	 aStruct AS USUAL
) AS LOGIC
View Source

Parameters

cSourceFile
Type: Usual
The name of the delimited text file from which to add records, including an optional drive, directory, and extension.  See SetDefault() and SetPath() for file searching and creation rules.  The default extension is .TXT.
This function attempts to open <cSourceFile> in shared mode.  If the file does not exist, a runtime error is raised.  If the file is successfully opened, the operation proceeds.  If access is denied because, for example, another process has exclusive use of the file, NetErr() is set to TRUE.  Refer to the "Concurrency Control" chapter in the Programmer's Guide for more information on resolving concurrency conflicts.
cDelim
Type: Usual
The delimiter used to separate fields in <cSourceFile>.  The default delimiter is a double quote mark.
acFields
Type: Usual
A list of fields to copy from <cSourceFile>.  The default is all fields.
cbForCondition
Type: Usual
A code block that defines a condition that each record within the scope must meet in order to be processed.
cbWhileCondition
Type: Usual
A code block that defines another condition that each record must meet in order to be processed.   As soon as a record is encountered that causes the condition to fail, the operation terminates.
If no scope is specified, <cbWhileCondition> changes the default scope to <lRest>.
You define the scope using one of these three, mutually exclusive arguments.  The default is all records.
nNext
Type: Usual
The number of records to append, starting at the first record.
nRecord
Type: Usual
The number of the record to append.
lRest
Type: Usual
TRUE or FALSE processes all records.
aStruct
Type: Usual

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
Tip Tip
The <nNext>, <nRecord>, and <lRest> arguments are mutually exclusive. You should not pass all three of them. And if you pass the <cbWhile> argument then this also controls the scope behavior.
DBAppDelim() is the functional equivalent of the APPEND FROM DELIMITED command.   It is the same as the DBApp() function except that it can be used only with text files.  See APPEND FROM and DBApp() for more information.
Examples
The following example appends records from a text file named SRCDELIM.TXT:
X#
USE test NEW
DBAppDelim("srcdelim.txt")
See Also

Reference

APPEND FROM
DBServer:AppendDelimited