# Loop a msg until bool ture

**URL:** <https://tech-community.robotics.abb.com/t/loop-a-msg-until-bool-ture/10664>\
**Category:** IRC5\
**Tags:** rapid, rapid-code\
**Created:** [March 29, 2022, 11:17am UTC](https://tech-community.robotics.abb.com/t/loop-a-msg-until-bool-ture/10664 "2022-03-29T11:17:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehammarin](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@ehammarin](https://tech-community.robotics.abb.com/u/ehammarin)\
**Post date:** [March 29, 2022, 11:17am UTC](https://tech-community.robotics.abb.com/t/loop-a-msg-until-bool-ture/10664/1 "2022-03-29T11:17:22Z")

</div>

Hey,

I have a msg line that i want to show until a bool is true.. How can i do this the easy way? I dont want to press any buttons for the robot to move on. Its on robotware 5.16

WHILE OkToSorter()=TRUE AND OkToPick\_1()=FALSE DO  
!  
st1:=“Empty”;  
st2:=“Empty”;  
st3:=“Empty.”;  
UIMsgBox  
\Header:=“Empty”,  
st1  
\MsgLine2:=st2  
\MsgLine3:=st3  
\Buttons:=btnOk  
\Icon:=iconWarning  
\Result:=ButtonAnswer  
\MaxTime:=2  
\BreakFlag:=err\_var;  
!  
ENDWHILE  
!  
ENDIF

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [March 29, 2022, 12:12pm UTC](https://tech-community.robotics.abb.com/t/loop-a-msg-until-bool-ture/10664/2 "2022-03-29T12:12:31Z")

</div>

Why not use a simple TPWrite?

---

<div class="post-metadata">

**Author:** ![Tompanhuhu](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/tompanhuhu/32/3366_2.png) [@Tompanhuhu](https://tech-community.robotics.abb.com/u/Tompanhuhu)\
**Post date:** [March 30, 2022, 2:58pm UTC](https://tech-community.robotics.abb.com/t/loop-a-msg-until-bool-ture/10664/3 "2022-03-30T14:58:58Z")

</div>

If it’s possible to use a signal (DI or DO) instead you could use dibreak / dobreak. Or maybe use a maxtime to close the messagebox and then show it again in your while-loop.

Or you could do as Lemster suggested and use a tpwrite instruction.

```auto
tpwrite "Waiting for condition.."; !Shows message on tpu
waituntil OkToSorter()=FALSE OR OkToPick_1()=TRUE;
tperase; !Clears tpu log

```
