# char() function

The char() function converts a number
between 0 and 255 to its corresponding ASCII character equivalent.

## Syntax

```
char(num.exp)
```

## Parameter(s)

| num.exp | Number between 0 and 255 to be converted to the corresponding ASCII character equivalent. Numbers over 255 are adjusted into the range 0 to 255 by taking the number modulo 256. |
| --- | --- |

## Description

Note: The arguments in the char() function must be numeric otherwise the [b16] run-time warning message displays.

## Example(s)

This causes the terminal to beep
once.

```
crt char(7)
```
This concatenates an *escape* with a `k` and assigns it to string.

```
string = char(27):"k"
```
This creates a constant at compile time to reference attribute
marks.

```
equ am to char(254)
```

## See also

- [crt statement](https://d3codex.com/pickbasic-flashbasic/crt-statement/)
- [BASIC functions](https://d3codex.com/pickbasic-flashbasic/basic-functions/)
- [Numeric expressions](https://d3codex.com/pickbasic-flashbasic/numeric-expressions/)
- [print statement](https://d3codex.com/pickbasic-flashbasic/print-statement/)
- [rem() function](https://d3codex.com/pickbasic-flashbasic/rem-function/)
- [seq() function](https://d3codex.com/pickbasic-flashbasic/seq-function/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)

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