How to display progressbar simulate in terminal window.
Thanks!
How to display progressbar simulate in terminal window.
Thanks!
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
Thanks Steve Robinson for your help.