home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / pibterm / pibt41s3.arc / PIBTERM.PAS < prev    next >
Pascal/Delphi Source File  |  1988-03-23  |  7KB  |  164 lines

  1. (*$M 25000,0,655360*)
  2. PROGRAM PibTerm;
  3.  
  4. (*----------------------------------------------------------------------*)
  5. (*               PibTerm --- Terminal Emulator in Turbo Pascal          *)
  6. (*----------------------------------------------------------------------*)
  7. (*                                                                      *)
  8. (*  Author:   (c) 1985, 1986, 1987 by Philip R. Burns                   *)
  9. (*                                                                      *)
  10. (*  Date:     January, 1987                                             *)
  11. (*  Version:  1.0  (January, 1985)                                      *)
  12. (*            2.0  (July, 1985)                                         *)
  13. (*            3.0  (October, 1985)                                      *)
  14. (*            3.2  (November, 1985)                                     *)
  15. (*            4.0  (September, 1987)                                    *)
  16. (*            4.1  (December, 1987)                                     *)
  17. (*                                                                      *)
  18. (*  Systems:  For MS-DOS on IBM PCs and close compatibles only.         *)
  19. (*            Note:  I have checked these on under MSDOS 2.x/3.x        *)
  20. (*                   on a variety of IBM PCs and clones.                *)
  21. (*                                                                      *)
  22. (*  Overview: This program provides a comprehensive terminal emulation  *)
  23. (*            and remote communications facility.  PibTerm emulates     *)
  24. (*            several different terminals.                              *)
  25. (*                                                                      *)
  26. (*            PibTerm allows for file transfer facilities using         *)
  27. (*            many different protocols.                                 *)
  28. (*                                                                      *)
  29. (*            The commands and general program use follow that of other *)
  30. (*            popular communications programs like PC-Talk and Qmodem.  *)
  31. (*                                                                      *)
  32. (*            PibTerm also provides a simple host communications        *)
  33. (*            facility like a mini-BBS.                                 *)
  34. (*                                                                      *)
  35. (*----------------------------------------------------------------------*)
  36. (*                                                                      *)
  37. (*                            Restriction                               *)
  38. (*                            -----------                               *)
  39. (*                                                                      *)
  40. (*           You may use this code only for NON COMMERCIAL purposes     *)
  41. (*           unless you explicitly obtain my permission.  I take a dim  *)
  42. (*           view of others making money on my work and those of other  *)
  43. (*           people whose code I've inserted here.                      *)
  44. (*                                                                      *)
  45. (*           Please feel free to add new features.  I wrote this        *)
  46. (*           program to give people a useful and usable basic terminal  *)
  47. (*           facility, and to show how Turbo Pascal can be used for     *)
  48. (*           asynchronous communications, menu display, windowing, and  *)
  49. (*           so on.  I hope that you find this program useful -- and,   *)
  50. (*           if you expand upon it, please upload your extensions so    *)
  51. (*           that all of us can enjoy them!                             *)
  52. (*                                                                      *)
  53. (*----------------------------------------------------------------------*)
  54. (*                                                                      *)
  55. (*           Suggestions for improvements or corrections are welcome.   *)
  56. (*           Please leave messages on Gene Plantz's BBS (312) 882 4145  *)
  57. (*           or Ron Fox's BBS (312) 940 6496.                           *)
  58. (*                                                                      *)
  59. (*----------------------------------------------------------------------*)
  60.  
  61. USES
  62.    PT4PATCH,  OverMgr,  Dos,      Crt,      GlobType,
  63.    StringMan, GlobRout, PibTimer, PibMTask, PibAsync,
  64.    PT4DIAL,   PT4EDIT,  PT4UTIL,  PT4VIEW,
  65.    PT4ASCI,   PT4CISB,  PT4DISPC, PT4KERM,  PT4XMOD,
  66.    PT4UPDWN,  PT4TERM,  PT4SETP,  PT4SCRI,  PT4INIT,
  67.    PT4GENRT,  PT4ANSI,  PT4GOSSI, PT4T4010, PT4HOST;
  68.  
  69.                                    (* Initialize PibTerm interface      *)
  70. {$I INITTERM.MOD }
  71.  
  72. (*----------------------------------------------------------------------*)
  73.  
  74. PROCEDURE Terminal_Emulations;
  75.  
  76. (* STRUCTURED *) CONST
  77.    PibTerm_Stops : STRING[18] = '*** PibTerm stops.';
  78.  
  79. (*----------------------------------------------------------------------*)
  80.  
  81. PROCEDURE Load_User_Terminal;
  82.  
  83. VAR
  84.    User_Number : INTEGER;
  85.  
  86. BEGIN (* Load_User_Terminal *)
  87.  
  88.    User_Number := SUCC( ORD( Terminal_To_Emulate ) - ORD( User1 ) );
  89.  
  90.    IF ( POS( '.CHN', UpperCase( User_Term_Name[User_Number] ) ) > 0 ) THEN
  91.       Emulate_User_Terminal
  92.    ELSE
  93.       Emulate_General_Terminal;
  94.  
  95. END   (* Load_User_Terminal *);
  96.  
  97. (*----------------------------------------------------------------------*)
  98.  
  99. BEGIN (* Terminal_Emulations *)
  100.  
  101.    REPEAT
  102.  
  103.       Gossip_Mode_On := ( Terminal_To_Emulate = Gossip );
  104.  
  105.       CASE Terminal_To_Emulate OF
  106.  
  107.          Ansi         : Emulate_Ansi( FALSE );
  108.  
  109.          VT100        : Emulate_Ansi( TRUE );
  110.  
  111.          VT52,
  112.          ADM3a,
  113.          ADM5,
  114.          TV925,
  115.          Dumb         : Emulate_General_Terminal;
  116.  
  117.          Gossip       : Emulate_Gossip;
  118.  
  119.          HostMode     : Emulate_Host;
  120.  
  121.          User1..User5 : Load_User_Terminal;
  122.  
  123.          TEK4010      : Emulate_TEK4010;
  124.  
  125.          ELSE;
  126.  
  127.       END (* CASE *);
  128.  
  129.    UNTIL ( PibTerm_Done );
  130.  
  131. END   (* Terminal_Emulations *);
  132.  
  133. (* ------------------------------------------------------------------------ *)
  134. (*                  PibTerm  --- Main Program                               *)
  135. (* ------------------------------------------------------------------------ *)
  136.  
  137. BEGIN (* PibTerm  *)
  138.                                    (* Initialize PibTerm              *)
  139.    InitTerm;
  140.                                    (* Begin Terminal Emulation        *)
  141.    REPEAT
  142.       Terminal_Emulations;
  143.    UNTIL ( PibTerm_Done );
  144.                                    (* Rewrite dialing directory       *)
  145.                                    (* if necessary                    *)
  146.    IF Any_Dialing_Changes THEN
  147.       BEGIN
  148.          Set_Text_Mode( Text_Mode );
  149.          Rewrite_Dialing_Directory;
  150.       END;
  151.                                    (* Clean up and terminate          *)
  152.    FiniTerm;
  153.                                    (* Clear screen unless error       *)
  154.  
  155.    IF ( NOT Error_Exit_Taken ) THEN
  156.       BEGIN
  157.          Window( 1, 1, Max_Screen_Col, Max_Screen_Line );
  158.          Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 0,
  159.                  LightGray, Black );
  160.          GoToXY( 1 , 1 );
  161.       END;
  162.  
  163. END   (* PibTerm  *).
  164.