August 11, 2022, 04:49:10 AM


Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........

How to delete a line in console?

Started by kibalab, October 29, 2007, 09:24:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


My program shall write

Calculating [Number] /

Then delete the line and write

Calculating [Number] -

Then delete again and write

Calculating [Number] \


Calculating [Number] |


How to do?


Hi Kiba,

Console programs are very limited as a user interface.

You can clear the whole screen using 'CLS' and write stuff again .. a bit of a sledgehammer approach ..  :)

or you can use 'LOCATE y,x' to position where you will print - and overwrite what was there before .. so you could 'backtrack on what you wrote previously.

The only other thing is to place a comma at the end of a print line to keep printing on the same line.

Those are your only options I think .. probably the 'LOCATE y,x' being the most useful.

If you want more control over colors and user presentation, consider using a simple window instead .. they are not too difficult to use, and look much nicer ..  :)

all the best,


Tomorrow may be too late ..


I was searching for something like \r in C.



I just noticed I'm off limits here in Aurora territory ..  :)

I've posted a small example in the Creative Basic Console section to illustrate the use of 'Locate y,x'.
I imagine it will be much the same in Aurora ..  :)

Tomorrow may be too late ..


Thank you, but I think I won't write my tiny program from scratch just to implement that little cosmetics  ;)
It's a math science program so beauty is very unimportant  :P


in C, \r is compilled as \13 or \x0d, so try thisprint("position is ", counter, "\x0d",)
// or
printf("position is %d\x0d", counter); // #include ""
// or
printf("position is %d%c", counter, 13);


I tried this but it didn't work. Anyway I now use GWS' method (coded my own ConsoleLine "manager" ^^ I love this language :P).