Recent

Author Topic: Compiled console application doesn't scroll down  (Read 5285 times)

kulverstukas

  • Guest
Compiled console application doesn't scroll down
« on: April 19, 2010, 08:56:11 pm »
Hey,
I have this problem and I have no idea what is wrong. My compiled console application doesn't scroll down when a lot of stuff must be written out (writeln();). Instead it just overwrites everything so it would fit on the screen. This wasn't happening with old 1.0.6 compiler. When I compile with the newest one, 2.4.0 - that thing happens.

Here is my code:
http://evilzone.org/paste/pastebin.php?show=224

Leledumbo

  • Hero Member
  • *****
  • Posts: 8700
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiled console application doesn't scroll down
« Reply #1 on: April 20, 2010, 06:25:42 am »
Remove Crt from your uses clause (it registers a video driver that's incompatible with standard console behavior), use Video unit to manipulate cursor position.

kulverstukas

  • Guest
Re: Compiled console application doesn't scroll down
« Reply #2 on: April 20, 2010, 07:34:03 pm »
But then nothing works... ClrScr, TextColor, Readkey, GotoXY and other stuff.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8700
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiled console application doesn't scroll down
« Reply #3 on: April 21, 2010, 06:26:38 am »
It can still be done though Keyboard and Video units, though the way will be very different. For example, ReadKey is roughly the same as GetKeyEventChar(TranslateKeyEvent(GetKeyEvent)). You may want to wrap this in a function to ease calling.
See the docs of relevant units below:
Keyboard: http://www.freepascal.org/docs-html/rtl/keyboard/index.html
Video: http://freepascal.org/docs-html/rtl/video/index.html

 

TinyPortal © 2005-2018