# Progressbar simulate

**URL:** <https://techcommunity.softwareag.com/t/progressbar-simulate/79881>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes, Natural-on-Windows-Unix\
**Created:** [January 8, 2009, 1:15am UTC](https://techcommunity.softwareag.com/t/progressbar-simulate/79881 "2009-01-08T01:15:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ekangal](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Ekangal](https://techcommunity.softwareag.com/u/Ekangal)\
**Post date:** [January 8, 2009, 1:15am UTC](https://techcommunity.softwareag.com/t/progressbar-simulate/79881/1 "2009-01-08T01:15:26Z")

</div>

How to display progressbar simulate in terminal window.

Thanks!

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [January 8, 2009, 1:41am UTC](https://techcommunity.softwareag.com/t/progressbar-simulate/79881/2 "2009-01-08T01:41:44Z")

</div>

Here is some code that creates a progress bar:

DEFINE DATA LOCAL  
1 #BAR (A60)  
1 #LOOP (P3)  
1 #PERC (P3)  
1 #DELAY (I2) INIT \<1\>  
1 #POS (P3)  
END-DEFINE  
\*  
FOR #LOOP = 1 TO 10  
COMPUTE #PERC = 10 \* #LOOP  
COMPUTE #POS = #LOOP \* 6 - 1  
RESET #BAR  
MOVE ‘\*’ TO SUBSTRING (#BAR,#POS,1)  
CALL ‘CMROLL’ #DELAY  
SET CONTROL ‘N’  
INPUT (AD=O IP=OFF) ‘PLEASE BE PATIENT…’ / #BAR (AD=V CD=PI DY=\*N%)  
/ ‘WE ARE’ #PERC ‘% FINISHED’  
END-FOR  
END

The CALL to CMROLL is to slow down the process; if you take the CALL out of the code, you will see what I mean.

The SET CONTROL ‘N’ is the “key” to the code. It says the next screen gets displayed, but the program does not pause waiting for the user to hit enter.

steve

---

<div class="post-metadata">

**Author:** ![Ekangal](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@Ekangal](https://techcommunity.softwareag.com/u/Ekangal)\
**Post date:** [January 8, 2009, 2:15am UTC](https://techcommunity.softwareag.com/t/progressbar-simulate/79881/3 "2009-01-08T02:15:17Z")

</div>

Thanks Steve Robinson for your help.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:51pm UTC](https://techcommunity.softwareag.com/t/progressbar-simulate/79881/4 "2021-04-02T14:51:20Z")

</div>

Closed on April 2, 2021, 2:51pm UTC


