# ID expression

An ID expression is a string expression that evaluates
to an item-ID, for use in all types of read and write statements.

## Example(s)

In this example, the `ID` expression is `"12345"`.

```
read invoice.item from invoice.file,"12345" else...
```
In this example, the value entered into the variable `ID` is used as the ID expression:

```
input ID
read record from file,ID else...
```
Both the literal string `'last-ID'` and
the arithmetic expression `last-ID+1` are ID expressions.

```
read last-ID from ctlfile,&#39;last-ID&#39; then
write item on datafile,last-ID+1
write last-ID+1 on ctlfile,&#39;last-ID&#39;
end
```

## See also

- [delete statement](https://d3codex.com/pickbasic-flashbasic/delete-statement/)
- [matread statement](https://d3codex.com/pickbasic-flashbasic/matread-statement/)
- [matwrite statement](https://d3codex.com/pickbasic-flashbasic/matwrite-statement/)
- [read statement](https://d3codex.com/pickbasic-flashbasic/read-statement/)
- [readv statement](https://d3codex.com/pickbasic-flashbasic/readv-statement/)
- [release statement](https://d3codex.com/pickbasic-flashbasic/release-statement/)
- [write statement](https://d3codex.com/pickbasic-flashbasic/write-statement/)
- [writev statement](https://d3codex.com/pickbasic-flashbasic/writev-statement/)
- [writevu statement](https://d3codex.com/pickbasic-flashbasic/writevu-statement/)

---
Source: https://d3codex.com/pickbasic-flashbasic/id-expression/ - part of the D3Codex reference.
