shadwickman 159 Posting Pro in Training

Hello. I haven't ever needed to bother trying to do things to the console such as clearing one line, changing colours, etc. But now I was wondering if there is a (preferably built-in) cross-platform way of clearing just the current line in the console.

I have a program which does a lot of calculations and I thought it would be nice to have one line clear and update with the percentage of the iterations done. I guess I'm looking for something similar to, say aptitude in GNOME (from the terminal); when it's downloading packages, it updates the one line with the current percentage downloaded.

I've looked at curses, but I honestly don't want to have to resort to that. If there isn't a simpler way of doing this sort of thing, I guess what I wanted it for isn't really required... it would just be handy to have.

Thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.