Navigation:  Classes > bArrayServer >

bArrayServer:Init()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Creates an object of the class bArrayServer.

Class

bArrayServer

Type

Method

Syntax

bArrayServer{

<auStruct>,

[<auData>],

[<iDeletedScope>],

[iDataFormat]

} Æ oArrayServer

Arguments

<auStruct>A two-dimensional array that defines the field structure of the server. The first dimension of the array defines the fields. The second dimension defines the structure of each field.
 
The second dimension consists of five elements that are described in the following table:

 

Constant

Data type

Description

DBS_NAME

String

Name of field.

DBS_TYPE

String

Data type of field.

DBS_LEN

Integer

Length of field, including the decimal point and the decimal places.

DBS_DEC

Integer

Number of decimals.

DBS_ALIAS

String

Alias of field.

 

Data type:Array

 

<auData>A two-dimensional array that contains the records of the server. The array has the format { {aRecord1}, {aRecord2},…{aRecordn} } where aRecordn is an array of field values {field1, field2, ….fieldn} . See the example below. If the argument is not supplied, the data server has no records. Use the property bArrayServer:Data to access individual data fields. This is done by specifying the record number and field number. ie:

 

auData[<Record>] [<Field>] or

auData[<Record>, <Field>]

 

Data type:Array

 

<iDeletedScope>A numeric value that indicates how deleted records are to be treated. The following values are supported:

 

Constant

Description

BINACTIVE

Deleted records are hidden.

BACTIVE

Deleted records are visible.

BAUTO

The setting of the function SetDeleted() is used.

 

If the argument is not specified, the value BAUTO is used.

Data type:Integer

 

<iDataFormat>A numeric value that indicates in which format the data in the data server is saved. The following values are supported:

 

Constant

Description

BDATAFORMAT_DBASE

DBase (Strings are filled up with blanks).

 

Note!
This value must be used, if in bArrayServer orders are created.

BDATAFORMAT_NORMAL

Normal (Strings are not filled up).

 

If the argument is not specified, the value BDATAFORMAT_NORMAL is used.

Data type:Integer

Return Value

oArrayServerThe created object of the class bArrayServer.
Data type:bArrayServer

Description

bArrayServer:Init() creates an object of class bArrayServer and initializes it.

Samples

The following sample creates an object of the class bArrayServer with the four fields ID, LASTNAME, FIRST NAME and AGE.

 

// define structure-array

auStruct := {;

                               {"ID", "C", 5, 0},;

                               {"LASTNAME", "C", 20, 0},;

                               {"FIRSTNAME", "C", 15, 0},;

                               {"AGE", "N", 3, 0};

                       }

 

// define data-array

auData := {;

                               {"00001", "Schmidt", "Harald", 41},;

                               {"00007", "Bond",    "James",  37};

                       }

 

// create bArrayServer

oasServer := bArrayServer{auStruct, auData, BINACTIVE}

See Also

bArrayServer:DBStruct

bArrayServer:Data

bArrayServer:DeletedScope

bArrayServer:IsDeletedInScope()

bArrayServer:Use()

bArrayServer:Used

 


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