Navigation:  Classes > bArrayServer >

bArrayServer:CopySDF()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Copy records into a SDF file. All records have the same length.

Class

bArrayServer

Type

Method

Syntax

<oArrayServer>:CopySDF(

<oFSTarget> | <cTarget>,

[<aiField> | <acField> | <asymField> | <aoDFField>],

[<uForCondition>],

[<uWhileCondition>],

[<uScope>]

) Æ lSuccess

Arguments

<oFSTarget>A file path as FileSpec. The SDF file is created to this path. An existing file is overwritten.
Data Type:FileSpec

 

<cTarget>A file path as string. The SDF file is created to this path. An existing file is overwritten.
Data Type:String

 

<aiField>An array of field numbers. The values of these fields are copied into the SDF 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 SDF 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 SDF 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 SDF 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 SDF 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 SDF file.
TRUEThe records were copied.
FALSEThe records could not be copied.
Data Type:Logic

Description

bArrayServer:CopySDF() copies all or single records from the ArrayServer into a SDF file. If the SDF 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 SDF file are separated from each other with CRLF. The field values within the records always have the same length. The field length is defined by the field structure in the ArrayServer and can be determined with the following method:

 

oArrayServer:FieldInfo(DBS_LEN, <uField>) -> <iFieldLen>

 

If argument 2 is not specified then all fields of the ArrayServer are copied into the SDF file.

 

When creating the SDF file only fields which are of the data type "C", "D", "L", or "N" are used. Fields of other data types are ignored.

 

Note!
After copying the record pointer is unchanged.

See Also

bArrayServer:CopyDB()

bArrayServer:CopyDelimited()

bArrayServer:CopyStructure()

bArrayServer:CopyToFile()

 


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