MODE CON:...

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
miskox
Posts: 380
Joined: 28 Jun 2010 03:46

MODE CON:...

#1 Post by miskox » 29 Jan 2021 13:08

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

jfl
Posts: 170
Joined: 26 Oct 2012 06:40
Location: Saint Hilaire du Touvet, France
Contact:

Re: MODE CON:...

#2 Post by jfl » 29 Jan 2021 14:58

Could it be that the 'mode con' moves the cursor to the top left corner every time?

Jer
Posts: 168
Joined: 23 Nov 2014 17:13
Location: California USA

Re: MODE CON:...

#3 Post by Jer » 29 Jan 2021 16:08

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

Post Reply