Purpose
Copy records into a text file. The field values of a record are separated from each other with a delimiter character.
Class
Type
Method
Syntax
<oArrayServer>:CopyDelimited(
<oFSTarget> | <cTarget>,
[<cDelimiter>],
[<aiField> | <acField> | <asymField> | <aoDFField>],
[<uForCondition>],
[<uWhileCondition>],
[<uScope>]
) Æ lSuccess
Arguments
<oFSTarget> | A file path as FileSpec. The text file is created to this path. An existing file is overwritten. |
Data Type: | FileSpec |
<cTarget> | A file path as string. The text file is created to this path. An existing file is overwritten. |
Data Type: | String |
<cDelimiter> | A single character which is inserted as a delimiter between the fields of a record into the text file. The character "," is used as default. |
Data Type: | String |
<aiField> | An array of field numbers. The values of these fields are copied into the text file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<acField> | An array of field names as string. The values of these fields are copied into the text file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<asymField> | An array of field names as symbol. The values of these fields are copied into the text file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<aoDFField> | An array of DataField objects. The values of these fields are copied into the text file. If omitted, all fields of the ArrayServer are used as default. |
Data Type: | Array |
<uForCondition> | A condition evaluated for each record in the scope. Only records for which evaluation of the condition returns TRUE are copied into the text file. |
Data Type: | String | Codeblock | _Codeblock |
<uWhileCondition> | A condition evaluated for each record from the current record until the condition returns FALSE. |
Data Type: | String | Codeblock | _Codeblock |
<uScope> | Define the range of records to process. The values below are supported: |
Value |
Description |
DBSCOPEALL |
The scope is all the records in the bArrayServer. This is the default. |
DBSCOPEREST |
The scope is the remaining records in the bArrayServer from the current position. |
<iRecords> |
The scope is the next <iRecords> records. |
Data Type: | Logic | Integer |
Return Value
lSuccess | A logical value indicates whether the records could be copied into the text file. |
TRUE | The records were copied. |
FALSE | The records could not be copied. |
Data Type: | Logic |
Description
bArrayServer:CopyDelimited() copies all or single records from the ArrayServer into a text file. If the text file already exists, then it is overwritten. The directory path for the file must already exist. It is not created automatically.
The records in the text file are separated from each other with CRLF. The field values within a record are separated with the character which was defined in the argument <cDelimiter>.
If argument 3 is not specified then all fields of the ArrayServer are copied into the text file.
When creating the text file only fields which are of the data type "C", "D", "L", or "N" are used. Fields of other data types are ignored. Blanks are removed automatically at the end of the value for fields with the data type STRING.
Note!
After copying the record pointer is unchanged.
See Also
Page url: http://www.YOURSERVER.com/index.html?barrayserver_copydelimited.htm