I really need help with this one 
Author Message
 I really need help with this one

Ok, how do I make a program that reads a text
file pause when the screen fills up?  I want it
to pause until a key is pressed.  I want it to
pause whenever the screen fills up.  Here is
an example program that I found in an archive.
What do I have to ad to it?

program Read_A_File;

ver Turkey        : TEXT;
    Big_String    : string[80];

begin  (* main program *)
   Assign(Turkey,'EXAMPLE.TXT');
   Reset(Turkey);
   while not Eof(Turkey) do begin
      Readln(Turkey,Big_String);
      Writeln(Big_String);
   end; (* of while loop *)
   Close(Turkey);
end. (* of program *)

If anyone can solve this problem for me
I will have the best week ever!  

Thanks in advance,
Rolland


http://www.*-*-*.com/ ~rheiss/index.htm



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one
You just need to keep a counter of how many lines are printed, and every
24th one pause.  

I've added lines to the code below.

I won't claim its perfect, but it should get you started.

Ken


Quote:

>Ok, how do I make a program that reads a text
>file pause when the screen fills up?  I want it
>to pause until a key is pressed.  I want it to
>pause whenever the screen fills up.  Here is
>an example program that I found in an archive.
>What do I have to ad to it?

>program Read_A_File;

>ver Turkey        : TEXT;
>    Big_String    : string[80];

     i             : Integer;
Quote:

>begin  (* main program *)
    i := 0;
>   Assign(Turkey,'EXAMPLE.TXT');
>   Reset(Turkey);
>   while not Eof(Turkey) do begin
>      Readln(Turkey,Big_String);
>      Writeln(Big_String);

       i := i + 1;
       if i mod 24 = 0 then repeat until keypressed; {pauses every 24th line}
       if keypressed readkey;      {keeps the keyboard buffer empty}

Quote:
>   end; (* of while loop *)
>   Close(Turkey);
>end. (* of program *)

--
Views expressed herein are not necessarily the views
of Ontrack Computer Systems, Inc. or Ontrack Data Recovery, Inc.
*******************************************************************
* Ken Stieers               |  Minneapolis - 1.800.872.2599       *
* AV Research/Apps. Eng.    |  Los Angeles - 1.800.752.7557       *
* Ontrack Computer Systems  |  Washington, D.C. - 1.800.650.2410  *
* Ontrack Data Recovery     |  London - 0800 24 39 96             *
* Eden Prairie, MN          |  Japan - 81.429.32-6365             *
*******************************************************************


Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one

RH>Ok, how do I make a program that reads a text
RH>file pause when the screen fills up?  I want it
RH>to pause until a key is pressed.  I want it to
RH>pause whenever the screen fills up.  Here is
RH>an example program that I found in an archive.
RH>What do I have to ad to it?

RH>program Read_A_File;

RH>ver Turkey        : TEXT;
RH>    Big_String    : string[80];

RH>begin  (* main program *)
RH>   Assign(Turkey,'EXAMPLE.TXT');
RH>   Reset(Turkey);
RH>   while not Eof(Turkey) do begin
RH>      Readln(Turkey,Big_String);
RH>      Writeln(Big_String);
RH>   end; (* of while loop *)
RH>   Close(Turkey);
RH>end. (* of program *)

RH>If anyone can solve this problem for me
RH>I will have the best week ever!

RH>Thanks in advance,
RH>Rolland


RH>http://www.wolfe.net/~rheiss/index.htm

This is pretty darn simple! Just add the following line in your WHILE/DO
loop, and define Ch as a char at the beginning of the program:

       if WhereY > 24 then Ch := ReadKey;

        -- Kim Forwood --

  /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

  %         For what purpose is life, if one cannot live freely?         $
  \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one

Try to simply put a "readln" between end; and close(Turkey);. Or you can
try it with the readkey-comand

Bye
Patrick



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one

Quote:

>Ok, how do I make a program that reads a text
>file pause when the screen fills up?  I want it
>to pause until a key is pressed.  I want it to
>pause whenever the screen fills up.  Here is
>an example program that I found in an archive.
>What do I have to ad to it?

Whip out a cheap counter that counts how many lines have been printed.
Use "i", for example, and put this in your loop:

i:= i + 1;
if (i div 20) = (i / 20) then
    begin
       ch:= readkey;
       clrscr;
   end;

Don't forgit to initilize "i".  "ch" in of type char.  This will pause
the program every 20 lines and return the char pressed in ch.


http://www.ac.net/~hneely/



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one


Quote:

>Ok, how do I make a program that reads a text
>file pause when the screen fills up?  I want it
>to pause until a key is pressed.  I want it to
>pause whenever the screen fills up.  Here is
>an example program that I found in an archive.
>What do I have to ad to it?

>program Read_A_File;

>ver Turkey        : TEXT;
>    Big_String    : string[80];

>begin  (* main program *)
>   Assign(Turkey,'EXAMPLE.TXT');
>   Reset(Turkey);
>   while not Eof(Turkey) do begin
>      Readln(Turkey,Big_String);
>      Writeln(Big_String);
>   end; (* of while loop *)
>   Close(Turkey);
>end. (* of program *)

>If anyone can solve this problem for me
>I will have the best week ever!  

>Thanks in advance,
>Rolland


>http://www.wolfe.net/~rheiss/index.htm

You need to place a counter variable around the read/write loop.
If your screen is 25 lines high, do something like this:

while not(eof(turkey)) do

   begin

        {  fill the screen all but the bottom line }
        for x := 1 to 24 do
           begin
              Readln(Turkey,Big_String);
              Writeln(Big_String);  
           end;

        {  prompt user for key on bottom line }

        write('Press any key to continue.');
        ch := readkey;

   end;

This will scroll one screen after another.  If you want the new screen
to begin again at the top, use the line:

        gotoxy(1,1);

after the ch := readkey;
This will put the cursor back in the upper left corner of the screen.



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one

Quote:



>>Ok, how do I make a program that reads a text
>>file pause when the screen fills up?  I want it
>>to pause until a key is pressed.

AFAICS, BM's solution will do what is required.

But the following approach may be preferred (do NOT run it in a Windows
DOS box) :

procedure ShowOne ;
var Str : string ;
begin while not EoF do begin
  Readln(Str) ; Write(Out, Str) ;
    if KeyPressed then begin
      if ReadKey=^C then Halt(1) ;
      if ReadKey=^C then Halt(1) end else Delay(166) ;
    Writeln(Out) end ;
  end {ShowOne} ;

One can stop or start by pressing any ordinary key; when stopped, one
can advance one line by pressing any extended key.
--



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one
hELP!  I am trying to write a program for a Pascal class and I wanted to be
able to use scanned images. Does anyone know of any pre-written code I can
use to manipulate bitmaps or tiffs or something like that?



Wed, 18 Jun 1902 08:00:00 GMT  
 I really need help with this one

Quote:

> Date: 9 Apr 1996 15:38:12 PST
> Path: news.NetVision.net.il!psinntp!psinntp!psinntp!gatech!newsfeed.internetmci.com!news.bctel.net!news.island.net!news.cn.camriv.bc.ca!access.cn.camriv.bc.ca!Kim.Forwood
> Newsgroups: comp.lang.pascal.borland


> Organization: CRCN

> Subject: Re: I really need help with this one
> Lines: 47

> RH>Ok, how do I make a program that reads a text
> RH>file pause when the screen fills up?  I want it
> RH>to pause until a key is pressed.  I want it to
> RH>pause whenever the screen fills up.  Here is
> RH>an example program that I found in an archive.
> RH>What do I have to ad to it?

> RH>program Read_A_File;

> RH>ver Turkey        : TEXT;
> RH>    Big_String    : string[80];

> RH>begin  (* main program *)
> RH>   Assign(Turkey,'EXAMPLE.TXT');
> RH>   Reset(Turkey);
> RH>   while not Eof(Turkey) do begin
> RH>      Readln(Turkey,Big_String);
> RH>      Writeln(Big_String);
> RH>   end; (* of while loop *)
> RH>   Close(Turkey);
> RH>end. (* of program *)

> RH>If anyone can solve this problem for me
> RH>I will have the best week ever!

> RH>Thanks in advance,
> RH>Rolland


> RH>http://www.wolfe.net/~rheiss/index.htm

> This is pretty darn simple! Just add the following line in your WHILE/DO
> loop, and define Ch as a char at the beginning of the program:

>        if WhereY > 24 then Ch := ReadKey;

>         -- Kim Forwood --

>   /-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-\

>   %         For what purpose is life, if one cannot live freely?         $
>   \-=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=--=oOo=-/

hi, i'm Or Moses
you can try this:

PROCEDURE pause;
var
proceed : char;

begin
write('press any key too continue. . .');
proceed := readkey;
writeln; writeln
end;



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. I really need help with this one

2. IS THERE REALLY NO ONE THAT CAN HELP?

3. help a realy really really new person at pascal

4. Come'on guys...I really need help...

5. Filter :I really need help !

6. Really need Help

7. Database access: really need some help

8. I really need ur help.......thanks

9. I really need ur help...

10. I really need Help!!!

11. Really need help on Database project!

12. Really need help on Database project!

 

 
Powered by phpBB® Forum Software