home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / CUNIT_20 / COMUNIT.REF < prev   
Text File  |  1992-03-18  |  5KB  |  104 lines

  1. (*************************************************************************
  2.  
  3.   INTERFACE for the best DOOR unit every assembled!
  4.  
  5.   Copyright (c) 1991-1992 Harms Software Engineering, all rights reserved.
  6.  
  7.   This is ONLY the beta version. Please DO NOT spread this unit around!
  8.  
  9.  *************************************************************************)
  10.  
  11. INTERFACE
  12.  
  13. Type CharSet = Set of Char;
  14.  
  15.      UserRec = Record
  16.                  Name: String[35];     { Name of the User online   }
  17.                  City: String[25];     { City where User lives     }
  18.                  TimeLeft: word;       { Time user has left        }
  19.                  TimeOut : byte;       { Inactivity time for user  }
  20.                  Ansi    : Boolean;    { Does the user support ANSI}
  21.                end;
  22.  
  23. var Port    : byte;               {comm port 0-3}
  24.     Baud    : word;               {current connect speed}
  25.     Online  : boolean;            {whether it's a local/remote login}
  26.     Mstatus : word;               {Modem status, word}
  27.     Foreground: byte;             {foreground color, so you can check and change...}
  28.     Background: byte;             {background color so you can check and change...}
  29.     Stop      : Boolean;          {variable used for some stop procedures.}
  30.  
  31.     ModemOnly : Boolean;          {If True then output will only be sent to
  32.                                    the modem!}
  33.  
  34.     SysopName : String;           {Name of the System Operator}
  35.  
  36.     ShowStatWin: Boolean;
  37.     User       : UserRec;
  38.  
  39. Procedure Send(s: string);        {modem equivalent of write}
  40. Procedure SendLn(s: string);      {modem equivalent of writeln}
  41. Procedure ReadStr(var s  : string;
  42.                       len: byte); {read a string with max length = len}
  43. Procedure ReadInt(var int: word;
  44.                       len: byte); {read a word with max number of chars = len}
  45. Procedure EditStr(var s  : string;
  46.                       len: byte); {edit a string with max length = len,
  47.                                    if the string s has a length > len then
  48.                                    len := length(s) !! }
  49. Procedure PortColor(f: byte);     {modem equivalent of textcolor}
  50. Procedure PortBackGround(b: byte);{modem equivalent of textbackground}
  51. Procedure ClrPortScr;             {modem equivalent of clrscr}
  52. Procedure ClrPortEol;             {modem equivalent of clreol}
  53. Procedure AutoAnsiDetect;         {detect if remote has User.Ansi support}
  54. Procedure PurgeInBuffer;          {purge input buffer}
  55. Procedure PortXY(x,y: byte);      {modem equivalent of gotoXY}
  56. Procedure DisplayFile(Fname: string;
  57.                       StopKeys: CharSet;
  58.                       PauseKeys: CharSet;
  59.                       Var Ch   : Char);
  60.                                   {display a file with hotkeys in set HotKeys}
  61. Function  WaitChar(Cset: CharSet): Char;
  62.                                   {waits till a key has been pressed in
  63.                                    Cset and returns that key}
  64.  
  65. Procedure InitTimes;              {you MUST run this after assign the
  66.                                    User.TimeLeft, and User.TimeOut variables in order
  67.                                    for the unit to start counting down...}
  68. Function  PortX: byte;            {modem equivalent of wherex}
  69. Function  PortY: byte;            {modem equivalent of wherey}
  70. Function  ReadChar: Char;         {modem equivalent of readch}
  71. Function  GetStatus: word;        {returns modem status}
  72. Function  PortKeyPressed: Boolean;{modem equivalent of keypressed}
  73.  
  74. Procedure ResetCounter(num: byte;Col: byte);
  75.                                   {reset line counter to num lines
  76.                                    and with prompt color = col}
  77. Procedure StopCounter;            {stop the line counter.}
  78. Procedure HangUp;                 {Hang up the modem!}
  79.  
  80. {Other helpfull functions and procedures}
  81.  
  82. Function  Ms(l: longint): string;     {convert a word to a string fast}
  83. Function  Rep(Ch: char;b: byte): string;
  84.                                   {Return a string with filled with Ch and
  85.                                    with length b}
  86. Function  UprCase(s: string): string;
  87.                                   {convert a string to uprcase}
  88. Procedure Trim(var s: string);    {Trim all leading and trailing #0 and #32}
  89. Function  Byte_Set(b,bit: byte): Boolean;
  90.                                   {Checks to see if bit is set in b}
  91. Function  Lz(w: word): String;    {Aka Leading Zero, adds a 0 before one digit
  92.                                    numbers, handy for dates!}
  93. Procedure Chat(Full: Boolean);    {Full refers to FULL screen or normal
  94.                                    move}
  95. Procedure ShowSysopStatWin;       {show sysop status window}
  96.                                   {This option isn't really finished yet, but
  97.                                    the part that is done works...}
  98. Procedure Delay(Num: byte);       {A replacement for the Delay in the CRT
  99.                                    unit. This Delay works with seconds, and
  100.                                    it works in and outside of DV}
  101.  
  102.  *************************************************************************)
  103.  
  104.