# writex statement

The writex statement writes the item
specified in *dyn.array.var* into the specified file,
using the item-ID specified in the *ID.exp*. The writex statement will wait until the actual disk update
takes place before continuing execution of the program. This is used
for "critical" write-through, such as error-logging.

## Syntax

```
writex dyn.array.var on {file.var,} ID.exp{onerr.clause}
```

## Parameter(s)

| dyn.array.var | Item to write to the specified file. |
| --- | --- |
| file.var | File onto which the dynamic array variable is written. If not specified, the default file variable is used. |
| ID.exp | Item-ID to assign to the new item being added to the file. |
| onerr.clause | An optional onerr.clause can be specified, which consists of the clause onerr followed by a statement block. The clause is taken if the update fails because the data source is unavailable (as can be the case if the file is remote), or if a callx correlative applied to the file fails because of an inputerr statement. |

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