<<

Contents

Search

>>

 

READS-PREVIOUS

 

 

Instruction

 

 

Syntax:

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

 

<Key Number>

= <NUM-EXPRESSION>

<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 secondary key <Key Number>. In the case of an error the block ON ERROR ... END is executed.

 

This instruction is only allowed if a valid READS-, STARTS-, READS-PREVIOUS- or READS-NEXT instruction has been executed before with the same key <Key Number>, otherwise the error 1021 is reported.

 

Parameter:

Key Number

Number of secondary key

Name of Index File

Name of Index File

 

Sample:

CUSTOMER.NAME$ = CHR$(255)

STARTS(1) CUSTOMER ON ERROR END

END% = 0

READS-PREVIOUS(1) CUSTOMER ON ERROR END% = 1 END

WHILE END% = 0

DO

   …

   READS-PREVIOUS(1) CUSTOMER ON ERROR END% = 1 END

ENDDO

 

See also:

Index File error numbers

READ

READS

READ-NEXT

READ-PREVIOUS

READS-NEXT

START

STARTS

READ_NEXT_MULTI

READ_PREVIOUS_MULTI

GET_FIRST_RECORD

GET_NEXT_RECORD

SEARCH

WRITE

DELETE

OK

OK2

ERRORTEXT$

EBUS_INDEXKEY$