home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s1.arc / INITCOMM.MOD < prev    next >
Text File  |  1988-02-25  |  4KB  |  114 lines

  1. (*----------------------------------------------------------------------*)
  2. (*         Initialize_Communications --- Initialize communications      *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Initialize_Communications;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Initialize_Communications                            *)
  10. (*                                                                      *)
  11. (*     Purpose:    Initializes serial port and modem                    *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Initialize_Communications                                     *)
  16. (*                                                                      *)
  17. (*----------------------------------------------------------------------*)
  18.  
  19. VAR
  20.    F      : FILE;
  21.    Text_F : TEXT;
  22.    Do_Scr : BOOLEAN;
  23.    Line   : AnyStr;
  24.    Ierr   : INTEGER;
  25.  
  26. BEGIN (* Initialize_Communications *)
  27.  
  28.                                    (* Get serial port initialized *)
  29.  
  30.    IF ( NOT Set_Params( TRUE , FALSE ) ) THEN
  31.       Halt( BadPort );
  32.                                    (* Give Program Notice *)
  33.  
  34.    Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 0,
  35.            Global_ForeGround_Color, Global_BackGround_Color );
  36.  
  37.    MoveToXY( 1 , 1 );
  38.  
  39.    WRITELN('PibTerm Version ', PibTerm_Version);
  40.    WRITELN(PibTerm_Date);
  41.    WRITELN(CopyRight_Notice);
  42.    WRITELN('Hit <ALT>I for command list.');
  43.  
  44.                                    (* Indicate if debug mode on *)
  45.    IF Debug_Mode THEN
  46.       BEGIN
  47.          WRITELN('*** Debug mode on ***');
  48.       END;
  49.                                    (* Initialize Modem        *)
  50.    Initialize_Modem;
  51.                                    (* Initialize Printer      *)
  52.    Initialize_Printer;
  53.                                    (* Pick up script file name if any, *)
  54.                                    (* and convert to executable form.  *)
  55.  
  56.    IF ( Script_File_Name <> '' ) THEN
  57.       BEGIN
  58.  
  59.          Do_Scr := FALSE;
  60.  
  61.          Add_Path( Script_File_Name, Script_Path, Script_File_Name );
  62.  
  63.          ASSIGN( F , Script_File_Name );
  64.             (*!I-*)
  65.          RESET( F );
  66.             (*!I+*)
  67.  
  68.          IF ( Int24Result = 0 ) THEN
  69.             BEGIN
  70.                   (*!I-*)
  71.                CLOSE( F );
  72.                   (*!I+*)
  73.                Do_Scr := TRUE;
  74.             END
  75.          ELSE
  76.             BEGIN
  77.                   (*!I-*)
  78.                CLOSE( F );
  79.                Ierr := Int24Result;
  80.                ASSIGN( Text_F , Script_Path + 'PIBTERM.SCL' );
  81.                RESET ( Text_F );
  82.                   (*!I+*)
  83.                IF ( Int24Result = 0 ) THEN
  84.                   BEGIN
  85.                      READLN( Text_F , Line );
  86.                      Line := Line + ' ';
  87.                      Do_Scr := ( UpperCase( COPY( Line, 1, 10 ) ) = '==PIBTERM ' );
  88.                   END;
  89.                   (*!I-*)
  90.                CLOSE( Text_F );
  91.                Ierr := Int24Result;
  92.                   (*!I+*)
  93.             END;
  94.  
  95.          IF Do_Scr THEN
  96.             Process_Script( Script_File_Name , 'E' );
  97.  
  98.       END;
  99. {
  100.    IF Debug_Mode THEN
  101.       IF TimeSharingActive THEN
  102.          BEGIN
  103.             WRITELN;
  104.             WRITE('Multitasker: ');
  105.             CASE MultiTasker OF
  106.                DoubleDos: WRITELN('DoubleDos');
  107.                DesqView:  WRITELN('DesqView');
  108.                TopView:   WRITELN('TopView');
  109.                TaskView:  WRITELN('TaskView');
  110.                ELSE       WRITELN('Other');
  111.             END (* CASE *);
  112.          END;
  113. }
  114. END   (* Initialize_Communications *);