# Routine with text box set to certain duration does not continue to next routine

**URL:** <https://discourse.psychopy.org/t/routine-with-text-box-set-to-certain-duration-does-not-continue-to-next-routine/18358>\
**Category:** Builder\
**Created:** [November 23, 2020, 1:42pm UTC](https://discourse.psychopy.org/t/routine-with-text-box-set-to-certain-duration-does-not-continue-to-next-routine/18358 "2020-11-23T13:42:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Linda\_Espey](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/linda_espey/32/12473_2.png) [@Linda\_Espey](https://discourse.psychopy.org/u/Linda_Espey)\
**Post date:** [November 23, 2020, 1:42pm UTC](https://discourse.psychopy.org/t/routine-with-text-box-set-to-certain-duration-does-not-continue-to-next-routine/18358/1 "2020-11-23T13:42:20Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10): Win 10  
**PsychoPy version** (e.g. 1.84.x): 3  
**Standard Standalone? (y/n)**: y  
\*\*What are you trying to achieve?: I am using a text box to get typed responses from my participants. Additionally the routine includes a text box for instructions. Both components are set to a duration of 30s. It works perfectly fine but it won’t continue to the next routine after the 30s. The routine is part of a loop.

**What did you try to make it work?:** I tried to use a code saying if t \>= 30.0: continueRoutine = False. This didn’t work.

**What specifically went wrong when you tried that?:** It doesn’t continue to the next routine. There is nor error message.  
Include pasted full error message if possible. “That didn’t work” is not enough information.

I hope it is understandable and maybe someone can help me with that. I would be very thankful!

---

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [November 23, 2020, 4:24pm UTC](https://discourse.psychopy.org/t/routine-with-text-box-set-to-certain-duration-does-not-continue-to-next-routine/18358/2 "2020-11-23T16:24:18Z")

</div>

Hello Linda

insert a code-element in the relevant routine. In the Begin Routine tab of the element insert

```auto
trialEnd = core.Clock()

```

In the Each Frame tab insert

```auto
if trialEnd.getTime() * 1000 >= 30000.00:
    continueRoutine = False

```

Best Jens

---

<div class="post-metadata">

**Author:** ![Linda\_Espey](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/linda_espey/32/12473_2.png) [@Linda\_Espey](https://discourse.psychopy.org/u/Linda_Espey)\
**Post date:** [November 25, 2020, 10:12am UTC](https://discourse.psychopy.org/t/routine-with-text-box-set-to-certain-duration-does-not-continue-to-next-routine/18358/3 "2020-11-25T10:12:24Z")

</div>

Thank you!!
