# (getkword \[prompt\])
[GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="190"></a>
## (getkword \[prompt\])
---
Ask the user to type a word.
---
This function works along with (equal statement1 statement2 \[tolerance\])(IDR\_166)(initget \[bits\] \[string\])(IDR\_205) to prompt for a response with restricted answers that you define ahead of time. For example, you may want the user to reply only "yes" or "no". Or, you may want to restrict the range of numbers that the user types to fall between 0 and 15\.
Using this function is a two-step process: (1) first, use **initget** to set the valid response keywords; and (2) then, use **getkword** to prompt for input. GstarCAD® displays a dialog box listing the valid responses set by **initget**, as well as the **Cancel** option.
If the input does not match the predetermined criteria, the function tells the user that the input is invalid with "Try again:" and cycles back to try again. If the input is null (the user pressed the **Enter** key), **getkword** returns *nil* unless a null input is not allowed.
If no keywords are preset with **initget**, *nil* is returned.
**Example**
| Code | Returns |
| --- | --- |
| (initget 2 "Yes No") (**getkword** "Are you sure? ") | *Displays dialog box.* |

**Tell me about...**
[(getstring \[flag\] \[prompt\])](%28getstring%20-flag-%20-prompt-%29.md)
[LISP Compatibility](../LISP%20Compatibility.md)
[Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md)
<a id="holding"></a>
## Other versions with matching text
[GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28getkword%20-prompt-%29.md)