# OBTAIN Get Hidden Terminal Input

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

## Format

**OBTAIN** (*chan*\[,*fileopt*\])*varlist*

***Where***:

|  |  |
| --- | --- |
| *chan* | Channel or logical file number of the file from which to get terminal input. |
| *fileopt* | Supported file options (see **[File Options](https://manual.pvxplus.com/appendix/input-output-and-control-options#Mark1)**):<br>\|  \|  \|  \|<br>\| --- \| --- \| --- \|<br>\| **BSY**=*stmtref* \| Traps Error #0: (Input timeout). \|  \|<br>\| **ERR**=*stmtref* \| Error transfer. \|  \|<br>\| **HLP**=*string$* \| Help message identifier. \|  \|<br>\| **IND**=*num* \| Position cursor to specified column number. \|  \|<br>\| **LEN**=*num* \| Limit on input size. \|  \|<br>\| **SIZ**=*num* \| Number of characters to read (number of screen columns). \|  \|<br>\| **TBL**=*stmtref* \| Data translation table. \|  \|<br>\| **TIM**=*num* \| Maximum time-out value in integer seconds. \|  \|<br>\|  \| *stmtref* \| Program line number or statement label to which to transfer control. \|<br>\|  \|  \|  \|<br>When screen positions are tight, you can combine the **LEN=** and **SIZ=** options to have PxPlus supply a scrolling input field.  <br>  <br>***Example:***  <br>  <br>To allow a user to enter 60 characters in a field where you only have room for 30 on the screen:<br>input (0,len=60,siz=30)"Name....:",N$ |
| *varlist* | Comma-separated list of variables, literals, mnemonics, **IOL=** options, and/or location functions **'@(...)'**. Include **[Format Masks](https://manual.pvxplus.com/appendix/data-format-masks)** to filter data being received. |

## Description

Use the **OBTAIN** directive to issue prompts to terminal devices and to process responses (the user's input). The file reference should be to a terminal, but you can use an indexed file. If you include literals or expressions in this directive, PxPlus treats them as prompts for the user.

You can include format masks, as in A$=STR(.01:"0.00"). If you omit the format mask for a numeric in the **OBTAIN** statement, the **'DP'** (Decimal Point Symbol) and **'TH'** (Thousands Separator) system parameters are ignored for European decimal settings.

Note:  
OBTAIN performs in the same way as the INPUT directive except that the user's input is not echoed on the screen. This can be useful for such applications as passwords.

## See Also

[ACCEPT Read Single Keystroke](https://manual.pvxplus.com/directives/accept)  
[INPUT Get Input from Terminal](https://manual.pvxplus.com/directives/input)  
['ME' Begin Edit Mode](https://manual.pvxplus.com/mnemonics/me)  
['BI' Begin Input Transparency](https://manual.pvxplus.com/mnemonics/bi)  
[Data Format Masks](https://manual.pvxplus.com/appendix/data-format-masks)

## Example

```
obtain 'CS',@(5,5),"Enter your password:",C$

->run
Enter your password:|
```

The password, "TEST" in this example, is not echoed, but C$ will return the value.

```
->?C$
TEST
```
