Progress display in console

Q&A's, tips, howto's
Locked
HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Progress display in console

Post by HPW »

Is this code the right method to display progress inside console-mode?
The backspaces bring back the cursor to linestart.

Code: Select all

(define (repstr str num , lst)
	(dotimes(x num) (push str lst))
	(join lst))

(dolist(linestr inputlist)
..
..
..
	(inc 'Loopcount)
	(if (=(mod Loopcount 1000)0)
	 (print (string (repstr "\008" 30)"Processing Line: " Loopcount))
	)
)
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

On your Solaris box the display code for backspace may or may not be different.

Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Yes you are right. It is a bit different, since it does not show every value. It should show everey 1000 line but the terminal is only updated about 19000 lines. But you see the progress and the screen is not full of messages. You see start, progress and end of session.
Hans-Peter

Locked