Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get a window width greater than 80 characters

Status
Not open for further replies.

Johnyq

Programmer
May 13, 2007
8
CA
I run a couple of apps written in Borland Pascal 7 in a window in versions 98 thru XP successfully. Does anyone know how to get a window wider than 80 characters. I am using recent Pentium machines with big monitors
 
I don't think that's possible. The best you can do is 80 character per line by 50 lines by using "Font8x8"
 
When I run the app in a window it doesn't use the 8x8 font but uses a true type font that looks really good.
The resulting window takes about 60% of the screen width, so there is room on the screen.
I don't know how windows decides what window width to use, but something is passing an arg to the window routine.
I have seen some references to accomplishing this on the web but no definitive method revealled.

Anybody else got any ideas?


Thanks

JY
 
I don't know how windows decides what window width to use, but something is passing an arg to the window routine.

Which you can't control from a DOS program. Now the alternative, if you really want to do it, is write your program so it uses a graphical font that can scale to more than 80 characters (BGI fonts), which will accomplish that.
 
You can increase the width of a command prompt window beyond 80 characters by right-clicking and selecting "properties". You can then run any dos-style program you like in that window. How it then behaves, I have no idea.
 
Glenn9999:
One advantage to running in a window is you get away from the
low res BGI fonts and get smooth good looking fonts instead.
The performance on modern machines is quite good.
The application is an IDE for writting 8051 assembly language.
It is tightly connected to the screen so conversion to Delphi might be a big job.
I might try FreePascal, I wonder how it handles text screens.

Lionelhill:
I can open a window and modify it properties to a larger width, but when I run my Pascal app it immediately re-sizes to
80 characters.

I wonder how Windows decides to do this?

Thanks for the help

JY
 
I might try FreePascal, I wonder how it handles text screens.

The same as everything else. 80 characters per line. That's how text-mode DOS works and how it always has worked. Converting to Delphi won't make a bit of difference, either, since you will have less control over the text console than you do under Pascal.
 
You are running a COMMAND window. the "MODE CON: COLS=x LINES=y " sets the console "CON:" file over ride. Then in your program print to the "CON:" file as a standard in/out.

it may work.

I have used each part of this solution "MODE" override(in a Qbasic program for 132 characters) & Standard output files(when writing my own command filters), just not together.

give it a try

I teach a lot of programming so I can learn. You can never learn it all.
 
I tried your mode command which did change the dos screen size.
But as soon as I started the app the screen returned to 80 character mode.

Persistent isn't it?

Thanks JY
 
I HAVE BEEN AWAY SO HERE GOES AGAIN.
In Qbasic I enter a statement that tells the application to set the width to 132 characters. This plus the MODE command allows me to put out a wide format. then to set up the output to print s wide format I send a ASCII string to the printer to turn the paper to landscape format so the file system won't limit it to 80 characters.

Example:

CLS
WIDTH "LPT1:", 132 ' PRINT ESCAPE SEQUENCE TO SET
' PRINTER INTO LANDSCAPE FORMAT
LPRINT CHR$(27); CHR$(38); CHR$(108); CHR$(49); CHR$(79);

In Qpascal I coded a similar process:

CONST
LANDSCAPE_MODE = CHR(27)+CHR(38)+CHR(108)+CHR(49)+CHR(79);
PORTRAIT_MODE = CHR(27)+CHR(38)+CHR(108)+CHR(48)+CHR(79);
|
|
ASSIGN(LSTOUT, 'C:\QP\INV_RPT.LST' );
or
ASSIGN(LSTOUT, '' );{use file redirect}
REWRITE(LSTOUT);
WRITE(LSTOUT, LANDSCAPE_MODE);

You can assign the output to a sequential file ur use the STDOUT redirection above.

I don't know if any of this will help you find a way through your programming problem but good luck.

I teach a lot of programming so I can learn. You can never learn it all.
 
Just a thought, might be totally wrong.

Could be that your application uses the crt unit. I'd sort-of half expect that the crt unit would have things that interact with the screen directly rather than console-mode writing via int21h, and this may be the trigger that's telling windows to return the "screen" to a typical VGA screen.

Interactions between dos and windows on screen-size are a bit of a mystery to me. For instance, a simple "dir" in a dos window on my home machine sometimes changes the screen mode and sometimes doesn't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top