Recent

Author Topic: help me!! about the margin  (Read 4366 times)

ching_tsoi

  • Newbie
  • Posts: 2
help me!! about the margin
« on: April 06, 2012, 08:47:39 pm »
How can all the content be shown?
It's a text file which I read in~~

I can't make the exexution windows bigger!

here is the printscreen of my problem:
http://imageshack.us/photo/my-images/851/16508090.png/


Please help, thanks so much~

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: help me!! about the margin
« Reply #1 on: April 07, 2012, 05:36:28 am »
Try using SetVideoMode from Video unit. Note that you shouldn't use Crt unit together with Video unit (Crt unit already manipulates the console).

ching_tsoi

  • Newbie
  • Posts: 2
Re: help me!! about the margin
« Reply #2 on: April 07, 2012, 08:29:44 am »
sorry, I don't understand~
how to use SetVideoMode in my program?

here is my program:
program music_voting;
USES CRT;
procedure welcome;
var
  welcometext: text;
  line:string;
begin
   clrscr;
  assign(welcometext,'welcome.txt');
  reset(welcometext);
  while not eof(welcometext) do
  begin
    readln(welcometext,line);
    writeln(line)
  end;
  close(welcometext)
end;

begin
  welcome;
  readln
end.       

ludob

  • Hero Member
  • *****
  • Posts: 1173
Re: help me!! about the margin
« Reply #3 on: April 07, 2012, 10:36:28 am »
On windows you can do the following:
Code: [Select]
uses
  windows;
var
  dwSize:COORD;
begin
  dwSize.X:=100;
  dwSize.Y:=25;
  SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE),dwsize);
....

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: help me!! about the margin
« Reply #4 on: April 07, 2012, 10:28:39 pm »
Quote
sorry, I don't understand~
how to use SetVideoMode in my program?
Read the link I gave above, and all other links you required there. And as I've said, DO NOT use Crt unit. ClrScr could be replaced by ClearScreen from Video unit.

If you're not diligent enough to explore the link, here are the quick steps:
  • Query the supported video modes using GetVideoModeCount and GetVideoModeData
  • Find the supported mode which has largest size (check Col and Row of the returned TVideoMode)
  • Take that mode and pass to SetVideoMode

 

TinyPortal © 2005-2018