# (while text statement …)
[GstarCAD 2011](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md)
<a id="308"></a>
## (while text statement ...)
---
Keep doing it while it's still true.
---
This function is a common loop in LISP. The *statement* controls whether the loop continues or breaks. When *statement* is true, the loop continues. When *statement* is nil, the loop breaks. The last *statement* before the nil is displayed.
**Example**
| Code | Returns |
| --- | --- |
| (setq x 25\) | |
| (**while** (/\= x 20\) | |
| (setq x (1- x) | |
| ) | 20 |
**Tell me about...**
[(cond (statement1 result1 ...) ...)](%28cond%20%28statement1%20result1%20...%29%20...%29.md)
[(if test statement1 \[statement2\])](%28if%20test%20statement1%20-statement2-%29.md)
[(repeat number statement1 \[statement2 ...\])](%28repeat%20number%20statement1%20-statement2%20...-%29.md)
[(setq symbol1 statement1 \[symbol2 statement2\] ...)](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%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 2012](../../../../2012/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28while%20text%20statement%20-%29.md)