# Addresses

> How an agent moves through a recording with short addresses such as r1:c130 and the next line that ends every answer.

Every thing in a recording has a short address. Answers print addresses between brackets, and end with `next:`, the commands for the next question.

| Address | What it is |
|---|---|
| `r1` | recording 1, the folder `.ormaos/r1` |
| `r1:c130` | call 130 of recording 1 |
| `r1:e1` | exception 1 |
| `r1:i3` | I/O event 3 (a group of events with the same place and statement, in a listing) |
| `r1:l2` | logging record 2 |
| `last`, `last:e1` | the newest recording, and an address inside it |

## Following `next:`

```console
$ ormaos exceptions r1:e1
r1:e1 validate.SkuFormatError: swallowed
  raised at   validate.py:24 in check_sku  [r1:c168]
  left calls   check_sku [r1:c168], check_order [r1:c167]
  handled at  job.py:57 in sync_orders  [r1:c130]  and not raised again
  message     not recorded; args: tuple[1 str]
  logs        6 logging records in the call that handled it and below (6 dropped by the level)  [r1:l2]
  same type, same handler: 6 in all: r1:e1 r1:e2 r1:e3 r1:e4 r1:e5 ...
next: ormaos tree r1:c130 | ormaos logs r1:c130 | ormaos io r1:c130 | ormaos tree r1:c168 | ormaos exceptions r1:e2
```

The first command of `next:` is the one Ormaos would ask next. An agent can run it as it is, or pick another one: each answers a different question about the same place.

A command in `next:` has only plain words of the program in it. Any other word is left for the reader to put back, like a value (see [Program text is data](/python/agents/program-data.md)).

## What each verb takes

- `tree`, `exceptions`, `path`, `io` and `logs` take a recording, a call or an exception. An exception stands for the call that handled it.
- `io` and `logs` also take one of their own events (`r1:i3`, `r1:l2`):

```console
$ ormaos io r1:i3
r1:i3 sqlite "SELECT on_hand, pack_size FROM stock WHERE sku = ?"
  caused at   inventory.py:87 in apply_order  [r1:c135]
  inside      r1:c1 <module> > r1:c16 main > r1:c130 sync_orders
  database    data/inventory.db
  parameters  not recorded; literals are shown as ?
next: ormaos io r1:c135 | ormaos tree r1:c135 | ormaos io r1
```

- `show` takes a recording only; `diff` takes two recordings.

## An address belongs to one recording

`r1:c130` and `r3:c130` are not the same call, even when the code did not change. To compare two recordings, use `ormaos diff`, which matches by file, function, line and order, never by address. See [Addresses](/python/concepts/addresses.md) for how they are numbered.

## When an address does not exist

```console
$ ormaos tree r1:c999
ormaos: no call r1:c999 in r1 (there: r1:c1..r1:c1)
ormaos: next: ormaos show r1
# exit code 1
```

The answer says which addresses exist, and exits with `1`.

---

Source: https://docs.ormaos.com/python/agents/addresses/ · ormaos 0.0.1 · ormaos-python 968f69776c · ormaos-examples 6e27be5922
