# ta() function

The ta() function returns the number of characters in the type-ahead
 buffer for the current process or for any other process.

## Syntax

```
ta(expr)
```

## Parameter(s)

| expr | An expression evaluating to the line number of the process to be checked. If expr evaluates to any negative number, the number of characters in the type-ahead buffer for the current process is returned. If expr evaluates to a number greater than the allowable maximum number of users, -1 is returned to indicate an error. |
| --- | --- |

## Description

When the type-ahead feature is on for a process, the ta() function returns
 the number of characters in the type-ahead buffer. The type-ahead buffer holds a maximum of 127
 characters at a time. If the type-ahead feature is off, the ta() function
 returns 0.

 To toggle the type-ahead feature on and off for the current process, the ta
 on and ta off statements may be used. To clear the type-ahead
 buffer for the current process, the ta clear or inputclear
 statement can be used.

 See [ta statement](https://d3codex.com/pickbasic-flashbasic/ta-statement/) for more information on controlling the
 type-ahead feature for the current process or for any other process.

## Example(s)

```
crt "Target process": ; input process
if process = "" then stop
crt "Chars in ta buff for process ":process:" is ":ta(process)
```

## See also

- [inputclear statement](https://d3codex.com/pickbasic-flashbasic/inputclear-statement/)
- [Statements and functions](https://d3codex.com/pickbasic-flashbasic/statements-and-functions/)
- [ta statement](https://d3codex.com/pickbasic-flashbasic/ta-statement/)

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