Page 1 of 1

MODE CON:...

Posted: 29 Jan 2021 13:08
by miskox
I wanted to (for fun) have a DOS window of size LINES=1, then display some text, expand the window to LINES=2, display more text etc. (so dynamically increase the window size).

Here is the code:

Code: Select all

@for /L %%f in (1,1,30) DO @mode CON: COLS=80 LINES=%%f&@echo THIS IS IT
And the result is not as expected because MODE clears the screen.

Instead of

Code: Select all

THIS IS IT
THIS IS IT
THIS IS IT
I have

Code: Select all

THIS IS IT




For fun only. Not really of any use (at the moment).

Saso

Re: MODE CON:...

Posted: 29 Jan 2021 14:58
by jfl
Could it be that the 'mode con' moves the cursor to the top left corner every time?

Re: MODE CON:...

Posted: 29 Jan 2021 16:08
by Jer
This produces a similar effect, increasing the window size with each line of text, but the screen is cleared with noticeable flicker before displaying each set of lines.

Code: Select all

@echo off
@for /L %%f in (1,1,31) DO @mode CON: COLS=80 LINES=%%f&for /L %%g in (1,1,%%f) DO @echo THIS IS IT
Jer