<<

Contents

Search

>>

 

READ-PREVIOUS

 

 

Instruction

 

 

Syntax:

READ-PREVIOUS <Name of Index File> ON ERROR … END

 

<Name of Index File> = <INDEX FILE>

 

Meaning:

Reads the previous data record (previous to the current record) from an Index File in the sorting order of the primary key. In the case of an error the block ON ERROR ... END is executed.

 

This instruction is only allowed if a valid READ-, START-, READ-PREVIOUS- or READ-NEXT instruction has been executed before, otherwise the error 1021 is reported.

 

Parameter:

Name of Index File

Name of Index File

 

Sample:

CUSTOMER.NUMBER = 99999999

START CUSTOMER ON ERROR END

END% = 0

READ_PREVIOUS CUSTOMER ON ERROR END% = 1 END

WHILE END% = 0

DO

   …

   READ-PREVIOUS CUSTOMER ON ERROR END% = 1 END

ENDDO

 

See also:

Index File error numbers

READ

READS

READ-NEXT

READS-NEXT

READS-PREVIOUS

START

STARTS

SEARCH

READ_NEXT_MULTI

READ_PREVIOUS_MULTI

GET_FIRST_RECORD

GET_NEXT_RECORD

WRITE

DELETE

OK

OK2

ERRORTEXT$

EBUS_INDEXKEY$