home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s4.arc / VIEWPMPT.MOD < prev    next >
Text File  |  1987-11-16  |  3KB  |  82 lines

  1. (*----------------------------------------------------------------------*)
  2. (*           View_Prompt --- prompt for end-of-screen                   *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE View_Prompt( VAR View_Done  : BOOLEAN;
  6.                        VAR View_Count : INTEGER );
  7.  
  8. (*----------------------------------------------------------------------*)
  9. (*                                                                      *)
  10. (*     Procedure:  View_Prompt                                          *)
  11. (*                                                                      *)
  12. (*     Purpose:    Issues end-of-screen prompt for view routines        *)
  13. (*                                                                      *)
  14. (*     Calling Sequence:                                                *)
  15. (*                                                                      *)
  16. (*        View_Prompt( VAR View_Done  : BOOLEAN;                        *)
  17. (*                     VAR View_Count : INTEGER );                      *)
  18. (*                                                                      *)
  19. (*           View_Done  --- TRUE if Stop option selected here           *)
  20. (*           View_Count --- Count of lines per panel.  May be changed   *)
  21. (*                          here if C option selected.                  *)
  22. (*                                                                      *)
  23. (*     Calls:   RvsVideoOn                                              *)
  24. (*              RvsVideoOff                                             *)
  25. (*                                                                      *)
  26. (*     Called by:                                                       *)
  27. (*                                                                      *)
  28. (*        View_A_File                                                   *)
  29. (*        View_A_Directory                                              *)
  30. (*        Get_Area_Code                                                 *)
  31. (*                                                                      *)
  32. (*----------------------------------------------------------------------*)
  33.  
  34. BEGIN (* View_Prompt *)
  35.  
  36.    View_Count := 1;
  37.    View_Y     := WhereY;
  38.  
  39.    REPEAT
  40.  
  41.       GoToXY( 1 , View_Y );
  42.       ClrEol;
  43.  
  44.       RvsVideoOn( Menu_Text_Color , BLACK );
  45.  
  46.       WRITE('Hit ENTER to continue, ESC to stop, ',
  47.             'C to continue non-stop: ');
  48.       ClrEol;
  49.  
  50.       RvsVideoOff( Menu_Text_Color , BLACK );
  51.  
  52.       Read_Kbd( View_Char[1] );
  53.  
  54.       IF ( View_Char[1] = CHR(ESC) ) THEN
  55.          BEGIN
  56.             IF PibTerm_KeyPressed THEN
  57.                BEGIN
  58.                   Read_Kbd( View_Char[1] );
  59.                   View_Char[1] := ' ';
  60.                END;
  61.          END
  62.       ELSE IF ( View_Char[1] IN ['S','s','C','c'] ) THEN
  63.          View_Char[1] := UpCase( View_Char[1] )
  64.       ELSE
  65.          View_Char[1] := ' '
  66.  
  67.    UNTIL( View_Char[1] IN [ 'S', 'C', ' ', ^[ ] );
  68.  
  69.    CASE View_Char[1] Of
  70.       'C':  View_Count := -MaxInt;
  71.       'S',
  72.       ^[ :  View_Done  := TRUE;
  73.       ELSE
  74.             ;
  75.    END (* CASE *);
  76.  
  77.    GoToXY( 1 , View_Y );
  78.    ClrEol;
  79.    GoToXY( 1 , View_Y );
  80.  
  81. END  (* View_Prompt *);
  82.