# inmat() function

The inmat() function returns information
about arrays.

## Syntax

```
inmat()
inmat(array.var)
```

## Parameter(s)

| array.var | Specifying an array variable returns the dimensions of that array. |
| --- | --- |

## Description

When used without any arguments,
the inmat() function returns the number elements
filled in the last matparse, matread, or dynamic to static array conversion. Note that inmat() is only valid immediately after these operations. If the number
of elements overflowed, then inmat() returns -1.

When used with an array variable, the inmat() function returns the dimensions of that array. If the array has
one dimension, then the result is returned as a numeric value. If
the array has two dimensions, then the result is returned as a dynamic
array of the format "{*maximum rows*}]{*maximum columns*}".

Note: This function requires an extended $options setting.

## Example(s)

```
dimension x(10)
print inmat(x)
x = "a"
print inmat()
```
When run, the program prints:

```
10
1
```

## See also

- [$options directive](https://d3codex.com/pickbasic-flashbasic/dollar-options-directive/)
- [Array variable](https://d3codex.com/pickbasic-flashbasic/array-variable/)

---
Source: https://d3codex.com/pickbasic-flashbasic/inmat-function/ - part of the D3Codex reference.
