home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / INITTEXT.MOD < prev    next >
Text File  |  1988-01-28  |  3KB  |  66 lines

  1. (*----------------------------------------------------------------------*)
  2. (*         Init_Text_Terminal --- Initialize text mode terminals        *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Init_Text_Terminal;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Init_Text_Terminal                                   *)
  10. (*                                                                      *)
  11. (*     Purpose:    Initializes text mode terminal emulations.           *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Init_Text_Terminal;                                           *)
  16. (*                                                                      *)
  17. (*----------------------------------------------------------------------*)
  18.  
  19. VAR
  20.    Cur_Video : INTEGER;
  21.  
  22. BEGIN (* Init_Text_Terminal *)
  23.                                    (* Ensure we're in text mode *)
  24.    Do_Status_Time := FALSE;
  25.  
  26.                                    (* Pick up terminal name     *)
  27.  
  28.    Short_Terminal_Name := Terminal_Name_List[ ORD( Terminal_To_Emulate ) ];
  29.  
  30.    Cur_Video := Current_Video_Mode;
  31.  
  32.    IF ( ( Cur_Video = HiRes_GraphMode ) OR
  33.         ( Cur_Video = EGA_GraphMode   )    ) THEN
  34.       BEGIN
  35.          Set_Text_Mode( Text_Mode );
  36.          IF EGA_Present THEN
  37.             Set_EGA_Text_Mode( Max_Screen_Line );
  38.          Reset_Global_Colors;
  39.       END;
  40.  
  41.    PibTerm_Window( 1, 1, Max_Screen_Col, Max_Screen_Line );
  42.  
  43.    Draw_Titled_Box( Saved_Screen, 10, 10, 55, 15, '' );
  44.  
  45.    WRITELN('Beginning ',
  46.            Long_Terminal_Names[ ORD( Terminal_To_Emulate ) ], ' Emulation');
  47.  
  48.    Window_Delay;
  49.  
  50.    Restore_Screen_And_Colors( Saved_Screen );
  51.  
  52.                                    (* Load function keys             *)
  53.    IF Auto_Load_FunKeys THEN
  54.       Load_Function_Keys( Short_Terminal_Name + '.FNC' );
  55.  
  56.                                    (* Scroll screen up if on last line *)
  57.  
  58.    IF ( WhereY = Max_Screen_Line ) THEN
  59.       BEGIN
  60.          GoToXY( WhereX , PRED( Max_Screen_Line ) );
  61.          Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 1,
  62.                  ForeGround_Color, BackGround_Color );
  63.       END;
  64.  
  65. END   (* Init_Text_Terminal *);
  66.