# Using a 'repeat' or 'while' loop crashes module

**URL:** <https://forum.intech.studio/t/using-a-repeat-or-while-loop-crashes-module/361>\
**Category:** The Lounge\
**Created:** [October 21, 2024, 12:50am UTC](https://forum.intech.studio/t/using-a-repeat-or-while-loop-crashes-module/361 "2024-10-21T00:50:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_d4ydream](https://forum.intech.studio/user_avatar/forum.intech.studio/_d4ydream/32/70_2.png) [@\_d4ydream](https://forum.intech.studio/u/_d4ydream)\
**Post date:** [October 21, 2024, 12:50am UTC](https://forum.intech.studio/t/using-a-repeat-or-while-loop-crashes-module/361/1 "2024-10-21T00:50:12Z")

</div>

Like the title says, if I try and use ‘repeat’ or ‘while’ in my code, my module crashes. I’m trying to delay a snippet of code from running until a variable == true. I was trying to nest these in an ‘IF’ statement but it would crash when I pushed the encoder to run my code. So, I put it into the simplest possible code and it crashes on init.

```auto
-- 'System' element 'Setup' page

t1 = 0
timer_start(16, 1000)
repeat
print(t1)
until t1 == 1
print('tock')

-- 'System' element 'Timer' page

t1 = 1
print('tick')
timer_start(16, 1000)
t1 = 0

```

As soon as you ‘Commit’ the code, the module crashes. I’ve tried with `repeat` and `while`.

Both will crash the module. Are these control structures not supported?
