Standardio: clearing the console output
BlitzMax Forums/BlitzMax Beginners Area/Standardio: clearing the console output
| ||
Hi, guys. I've tried searching the forums and google and couldn't find anything like it. How can you clear the output from a console window? Like old DOS command 'cls'. Can this be done? Thanks. :) |
| ||
not possible. |
| ||
damn... :P |
| ||
How can you clear the output from a console window? Like old DOS command 'cls' You can print a bunch of blank lines which essentially scrolls it out of view, but if people have a larger buffer enabled then you still have the ability to scroll back up to see the info. |
| ||
You can print a bunch of blank lines which essentially scrolls it out of view Heh :-) not possible. Of course it is! How can you clear the output from a console window? A console or *the* BlitzMax console? From the BlitzMax console... no, you can't. From a console window - like a DOS box or Mac/Linux Terminal window - yes, you can. But you need to know what special escape sequences you need to send to it. |
| ||
I don't think Microsoft has supported ANSI since win98. |
| ||
@Brucey: yes, I was talking about the standardio functions Print and Input. I was only using them in my application without any GUI like a command-line tool. Thanks for the advices, guys. The problem is I'm making this command-line tool that allows the user to type in a password before having access to its features. But after the user logs in I want to remove the password from the screen, clearing what was typed. Are there no workarounds? :( Thanks again. |
| ||
Accept the keystrokes without printing them, then just print asterisks. |
| ||
But how exactly? With getchar? Sorry about the question. That's why I've asked on the beginner's forum even though I knew it wasn't possible using only standardio. :) I'm not sure how to begin. Which module should I use? Which functions should I use? Thanks in advance. |
| ||
maybe you could do thousands of blank lines... the scroll bar has a limit so then even if you did scroll to the top, it wwould be gone |
| ||
HERE is a little Windows app made in BlitzMax. You need to run it from the console/cmd. Possibly the kind of control over the console you are looking for... |
| ||
This will do the trick It only works on the runtime console window so you won't see anything happening in the Blitz IDE output Windows only |
| ||
Nice code. Thank you all. |
| ||
Win7 not function......... |
| ||
If you only need to change the last line, using ~r alone is quite nice. Can rewrite the last line, making progress bars and such easy. This doesnt work for the standard inputs though, so need to role your own. One which doesnt echo the newline specifically. NOTE: This only works directly in a console. Oh, and if your on Windows 10 the Console supports basic ANSI now, which makes all this much easier ;) |
| ||
"_getch" is not available here on my box (linux, gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ). bye Ron |
| ||
"getch" should be. |