---
title: WHILE
slug: docs-sb3-while
system: SmileBASIC 3
type: command
category: Basic instructions (control and branching)
source: InstructionList.pdf
forms: 1
scraped: 2026-06-21
---
# WHILE
> **Category:** Basic instructions (control and branching)
Repeats the process up to WEND while the condition is satisfied
- Exits the loop if the condition is not satisfied or when the BREAK instruction is executed
## Format
```sb3
WHILE Conditional expression
```
## Conditional Expressions
| Item | Description |
| --- | --- |
| `The same conditional expressions as in IF statements can be specified` | |
| `Comparison
Operators` | == Equal to
!= Not equal to
> Greater than
< Smaller than
>= Equal to or greater than
<= Equal to or smaller than |
| `Logical operators
(for comparison
with multiple
conditions)` | (Condition 1 AND Condition 2) Both of the two conditions must be satisfied
(Condition 1 && Condition 2) Both of the two conditions must be satisfied
(Condition 1 OR Condition 2) Either of the two conditions must be satisfied
(Condition 1 \|\| Condition 2) Either of the two conditions must be satisfied
* The key "\|\|" can be found to the upper left of ? on your keyboard. |
## Examples
```sb3
A=0:B=4
WHILE A