# prvkey statement

The prvkey statement operates in the same manner as the
 nxtkey statement with the exception that the keys returned are those previous
 to the beginning key value key.

## Syntax

```
PRVKEY result FROM filevar,a.code,key,n THEN/ELSE
```

## Parameter(s)

| result | Returned variable containing the keys retrieved in a multi-attribute dynamic array. |
| --- | --- |
| filevar | Variable to which the data file has been opened. |
| a.code | String expression containing the a (algebraic) processing code located in the file-defining item that identifies the index to use. The index must have previously been created with create-index. |
| key | Beginning key value at which to begin the retrieval. |
| n | Number of keys to retrieve. |

## Description

The keys are returned in what might be viewed as reverse order, and a short list is due to a
 beginning file condition.

## See also

- [Cruising and zooming commands](https://d3codex.com/updateprocessor/cruising-and-zooming-commands/)
- [key statement](https://d3codex.com/pickbasic-flashbasic/key-statement/)
- [nxtkey statement](https://d3codex.com/pickbasic-flashbasic/nxtkey-statement/)
- [root statement](https://d3codex.com/pickbasic-flashbasic/root-statement/)
- [then/else statement blocks](https://d3codex.com/pickbasic-flashbasic/then-else-statement-blocks/)
- [verify-index command](https://d3codex.com/tcl/verify-index-command/)

---
Source: https://d3codex.com/pickbasic-flashbasic/prvkey-statement/ - part of the D3Codex reference.
