# Attribute count expression

An attribute count expression (ac expression) is any numeric
constant or any arithmetic, logical, or string expression that evaluates
to a valid numeric value, used to reference an attribute count within
statements, functions, and arrays or string variable.

## Example(s)

In the following example, 1 is the attribute count expression.

```
readv company.name from customer.file,cust-ID,1 else...
```
The variable `apos` must be numeric; in
this case it is a 2.

```
apos = 2
readv company.address from customer.file,cust-ID,apos else...
```
The numeric constant 1 indicates attribute 1 of the string
in the *customer.item* variable.

```
customer.item<1> = "test string"
```
The arithmetic expression, `bpos+i`, calculates
the attribute position in *audit.item*.

```
audit.item<bpos+i> = amount.list<bpos>
```

## See also

- [() reserved characters](https://d3codex.com/pickbasic-flashbasic/parenthesis-reserved-characters/)
- [Data representation](https://d3codex.com/pickbasic-flashbasic/data-representation/)
- [extract() function](https://d3codex.com/pickbasic-flashbasic/extract-function/)
- [ins statement](https://d3codex.com/pickbasic-flashbasic/ins-statement/)
- [insert() function](https://d3codex.com/pickbasic-flashbasic/insert-function/)
- [locate statement](https://d3codex.com/pickbasic-flashbasic/locate-statement/)
- [lt relational operator](https://d3codex.com/pickbasic-flashbasic/lt-relational-operator/)
- [readv statement](https://d3codex.com/pickbasic-flashbasic/readv-statement/)
- [ereplace() function](https://d3codex.com/pickbasic-flashbasic/ereplace-function/)
- [Subvalue count expressions](https://d3codex.com/pickbasic-flashbasic/subvalue-count-expressions/)
- [Value count expression](https://d3codex.com/pickbasic-flashbasic/value-count-expression/)
- [writev statement](https://d3codex.com/pickbasic-flashbasic/writev-statement/)
- [writevu statement](https://d3codex.com/pickbasic-flashbasic/writevu-statement/)

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