<<

Contents

Search

>>

 

READS

 

 

Instruction

 

 

Syntax:

READS(<Key Number>) <Name of Index File> ON ERROR … END

 

<Key Number>

= <NUM-EXPRESSION>

<Name of Index File>

= <INDEX FILE>

 

 

Meaning:

Reads a record from an Index File by a secondary key.

 

The data record which is specified by the current values of the date fields of the secondary key <Key Number> is read from the Index File. In the case of an error the block ON ERROR ... END is executed.

 

If there are several data records with the same secondary key in one Index File, the first found data record is read. The other data records can be read by the instruction READS-NEXT (<Key Number>).

 

Parameter:

Key Number

Number of secondary key (1,…)

Name of Index File

Name of Index File

 

Sample:

CUSTOMER.NAME$ = "Smith"

READS(1) CUSTOMER

         ON ERROR ERRORMES = "Customer " + NOBLANK$(1,CUSTOMER.NAME$) +

                             " not found. Error " +

                             STR$(OK) + STR$(OK2) + " " + ERRORTEXT$

         END

 

See also:

Index File error numbers

READ

READ-NEXT

READS-NEXT

READ-PREVIOUS

READS-PREVIOUS

START

STARTS

READ_NEXT_MULTI

READ_PREVIOUS_MULTI

GET_FIRST_RECORD

GET_NEXT_RECORD

SEARCH

WRITE

DELETE

OK

OK2

ERRORTEXT$

EBUS_INDEXKEY$