# _CP_system

The _CP_system function is equivalent to the
 `*result* = system(*expression*)` BASIC
 statement.

## Syntax

```
 int _CP_system(CPSTR** result, int expression, int pib)
```

## Description

This function returns -1 if
an error occurs. The error code is contained in _CP_errno.

## Parameter(s)

| result | The return contents of the system function. |
| --- | --- |
| expression | The system function number to perform. See the BASIC system() function topic for the detailed list of values. |
| pib | The line number of the pib from which to return data. To return data for your own line, -1 can be used. |

## Example(s)

```

 /* Get a unique item-ID in s */
 CPSTR * s = _CP_str_null;
 _CP_system(&s, 19, -1);
```

## See also

- [C functions overview](https://d3codex.com/cfunctions/c-functions-overview/)
- [system() function](https://d3codex.com/pickbasic-flashbasic/system-function/)

---
Source: https://d3codex.com/cfunctions/cp-system/ - part of the D3Codex reference.
