# ins statement

The ins statement is an alternative
to the insert() function for inserting a string
expression into a dynamic array.

## Syntax

```
ins str.exp before dyn.array.exp< ac.exp{,vc.exp{,sc.exp}}>
ins str.exp before dim.array.exp(element)< ac.exp{,vc.exp{,sc.exp}}>
```

## Parameter(s)

| str.exp | Specifies the element to insert in the dynamic array. |
| --- | --- |
| array.exp | Specifies the dynamic or dimensioned array in which the element will be inserted. |
| ac.exp | Specifies the attribute in which the element will be inserted. |
| vc.exp | Specifies the value in which the element will be inserted. |
| sc.exp | Specifies the subvalue in which the element will be inserted. |

## Example(s)

```
x<1> = "a"
x<2> = "c"
ins "b" before x<2>
print x
a^b^c
```

## See also

- [Attribute count expression](https://d3codex.com/pickbasic-flashbasic/attribute-count-expression/)
- [del statement](https://d3codex.com/pickbasic-flashbasic/del-statement/)
- [insert() function](https://d3codex.com/pickbasic-flashbasic/insert-function/)
- [locate statement](https://d3codex.com/pickbasic-flashbasic/locate-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/)

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