# ACCEPT Read Single Keystroke

> Source: https://manual.pvxplus.com/directives/accept

## Format

ACCEPT(*chan*\[,*fileopt*\])*char$*  

***Where***:

|  |  |
| --- | --- |
| *chan* | Channel or logical file number. |
| *char$* | String variable. Receives the input character. |
| *fileopt* | Supported file options. See **[File Options](https://manual.pvxplus.com/appendix/input-output-and-control-options#Mark1)**:<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **ERR**=*stmtref* \| On error, transfer to program line number/statement label \|<br>\| **NUL**=*stmtref* \| On no input, transfer to program line number/statement label \|<br>\| **TIM**=*num* \| Maximum time-out value in integer seconds \| |

## Description

Use the **ACCEPT** directive to read a single keystroke (character) from a terminal. The **ACCEPT** directive does not echo the keystroke/character to the terminal.

If no input is in the input buffer, the **ACCEPT** directive waits for terminal input. Control transfers to the *stmtref* if you include a **NUL=** option and the terminal input buffer has no data in it.

## See Also

**[OBTAIN Get Hidden Terminal Input](https://manual.pvxplus.com/directives/obtain)**  
**[INPUT Get Input from Terminal](https://manual.pvxplus.com/directives/input)**

## Example

This example reads one record at a time and displays it on the terminal. When any key is pressed, control drops to line 0130 (ending the listing of the file).

```
0100 read record (1,end=0130)R$
0110 print R$
0120 accept (0,nul=0100,tim=0.5)X$
0130 print "<Display halted>"
```
