Navigation:  Classes > bArrayServer >

bArrayServer:Locate()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Search sequentially for a record to meet a condition.

Class

bArrayServer

Type

Method

Syntax

<oArrayServer>:Locate(

<uForBlock>,

[<uWhileBlock>],

[<uScope>]

) Æ lFound

Arguments

<uForBlock>The condition that the searched record must meet. If the condition is specified as a string, it is converted automatically into a _Codeblock statement. The conversion is made here by the command

umgewandelt. Die Umwandlung erfolgt hierbei über den Befehl

 

&("{|Server| "+uForBlock+"}")

 

As a default, the value NIL is used.

Data Type:String | Codeblock | _Codeblock

 

<uWhileBlock>The condition that each record must satisfy, so that <uForBlock > evaluates for each record. As soon as a record is found that fails the condition, the operation is terminated. If the condition is specified as string, it is converted automatically into a _Codeblock statement. The conversion is made here by the command

 

&("{|Server| "+uWhileBlock+"}")

 

As a default, the value NIL is used.

Data Type:String | Codeblock | _Codeblock

 

<uScope>The range of records to process. The following values are supported:

 

Constant

Description

DBSCOPEALL

The scope contains all records. This is the default. If a WHILE condition is specified, DBSCOPEREST is uses.

DBSCOPEREST

The scope contains the remaining records beginning with the current record.

<nRecord>

The scope contains the next <nRecord> records.

 

Data Type:Usual

Return Value

lFoundA logical value that indicates if a record was found.
TRUEA record was found.
FALSENo record was found.
Data Type:Logic

Description

bArrayServer:Locate() searches sequentially through all records in the server until one is found to correspond to the specified condition. If a record was found, the record pointer is positioned to this record. Otherwise the record pointer is placed to EoF.

 

In order to be able to execute fields, methods and accesses of the server within the conditions <uForBlock> or <uWhileBlock>, the literal "Server" followed by a colon must be placed in front of them (see sample).

Samples

The following sample search on the field LASTNAME.

 

oasServer:Locate({|Server| UPPER(Server:LASTNAME)=="BOND"})

See Also

bArrayServer:Seek()

 


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