Navigation:  Classes > bArrayServer >

bArrayServer:CopyDelimited()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Copy records into a text file. The field values of a record are separated from each other with a delimiter character.

Class

bArrayServer

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

lSuccessA logical value indicates whether the records could be copied into the text file.
TRUEThe records were copied.
FALSEThe 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

bArrayServer:CopyDB()

bArrayServer:CopySDF()

bArrayServer:CopyStructure()

bArrayServer:CopyToFile()

 


Page url: http://www.YOURSERVER.com/index.html?barrayserver_copydelimited.htm