Recent

Author Topic: How to scroll up?  (Read 4440 times)

gabrieljim

  • New Member
  • *
  • Posts: 13
How to scroll up?
« on: July 17, 2018, 09:50:57 pm »
I noticed that the "uses crt;" line always blocks the scrolling on the command line, but I use a lot of clrscr and readkey, is there a workaround for this? Maybe a replacement for the crt? I hope someone can help!

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: How to scroll up?
« Reply #1 on: July 18, 2018, 11:22:28 am »
I did a small test and I can't see your problem:

Code: Pascal  [Select][+][-]
  1. PROGRAM Test;
  2. USES crt;
  3. BEGIN WHILE NOT KeyPressed DO WriteLn (Random (10000)) END.

May be you can provide a code that shows that "blocking"?
« Last Edit: July 18, 2018, 11:25:28 am by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Gammatester

  • Jr. Member
  • **
  • Posts: 69
Re: How to scroll up?
« Reply #2 on: July 18, 2018, 11:55:21 am »
I guess, mean that you cannot use e.g. the Up and Down arrow keys to scroll through the  input line history as in the following program
Code: Pascal  [Select][+][-]
  1. //uses crt;
  2. var
  3.   s: string;
  4. begin
  5.   repeat
  6.     readln(s);
  7.     writeln(s);
  8.   until s='';
  9. end.
  10.  
if you enable the uses crt. Without CRT you have access to the input line history.

If this is your problem, then AFAIK it cannot be fixed because this feature is a result of the operating system handling of the files input and output. If you use CRT, input and output are handled via the Pascal RTL and you would have to implement this feature in the CRT source code.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: How to scroll up?
« Reply #3 on: July 19, 2018, 10:31:13 am »
I guess, mean that you cannot use e.g. the Up and Down arrow keys to scroll through the  input line history (...)
I never had such behavior, no matter the input method or operating system I use. %)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Gammatester

  • Jr. Member
  • **
  • Posts: 69
Re: How to scroll up?
« Reply #4 on: July 19, 2018, 11:09:39 am »
I guess, mean that you cannot use e.g. the Up and Down arrow keys to scroll through the  input line history (...)
I never had such behavior, no matter the input method or operating system I use. %)
At least under WinXP, Windows8, Windows 7 (32 and 64-bit) it is available for all FPC versions (not surprising, because as I said it is a feature of the OS). But with Raspi/Debian it does not work (at least not with Up/Down arrow, which are echoed as ^[[A and ^[[B without further action).

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: How to scroll up?
« Reply #5 on: July 20, 2018, 11:30:47 am »
I guess, mean that you cannot use e.g. the Up and Down arrow keys to scroll through the  input line history (...)
I never had such behavior, no matter the input method or operating system I use. %)
At least under WinXP, Windows8, Windows 7 (32 and 64-bit) it is available for all FPC versions (not surprising, because as I said it is a feature of the OS). But with Raspi/Debian it does not work (at least not with Up/Down arrow, which are echoed as ^[[A and ^[[B without further action).
WindowsXP?  May be it is because I use MSYS (MingW32 POSIX-like shell) that I never realized that.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

gabrieljim

  • New Member
  • *
  • Posts: 13
Re: How to scroll up?
« Reply #6 on: July 21, 2018, 06:19:12 pm »
I guess, mean that you cannot use e.g. the Up and Down arrow keys to scroll through the  input line history as in the following program
Code: Pascal  [Select][+][-]
  1. //uses crt;
  2. var
  3.   s: string;
  4. begin
  5.   repeat
  6.     readln(s);
  7.     writeln(s);
  8.   until s='';
  9. end.
  10.  
if you enable the uses crt. Without CRT you have access to the input line history.

If this is your problem, then AFAIK it cannot be fixed because this feature is a result of the operating system handling of the files input and output. If you use CRT, input and output are handled via the Pascal RTL and you would have to implement this feature in the CRT source code.

Yeo that's what I meant, I just enjoy the clrscr; function, but if it cannot be fixed oh well, thanks for answering :)

 

TinyPortal © 2005-2018