home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / BBSEDIT.ZIP / RAEDITOR.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1994-04-12  |  4.2 KB  |  122 lines

  1. {$A+,B-,D+,E-,F-,I-,L+,N-,O-,R-,S+,V-}
  2. {$M 10000,0,64000}
  3. {╔═════════════════════════════════════════════════════════════════════════╗
  4.  ║                                                                         ║
  5.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  6.  ║                                                                         ║
  7.  ║ Author    : Gerhard Hoogterp                                            ║
  8.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  9.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  10.  ║                                                                         ║
  11.  ║ SnailMail : Kremersmaten 108                                            ║
  12.  ║             7511 LC Enschede                                            ║
  13.  ║             The Netherlands                                             ║
  14.  ║                                                                         ║
  15.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  16.  ║                                                                         ║
  17.  ╚═════════════════════════════════════════════════════════════════════════╝}
  18.  
  19. Program EditorDemo; { How to use the online editor }
  20. Uses LowLevel,
  21.      GlobInfo,
  22.      UserHook,
  23.      Fossil,
  24.      Filter,
  25.      RA,
  26.      BBSedit;  {*}
  27.  
  28. Var Body  : BodyType;      { The textbuffer           }
  29.     Lines : Byte;          { The number of lines used }
  30.     Foss  : FossilObject;  { And a fossil object      }
  31.  
  32. Begin
  33.  
  34.       { Read all the BBS dependend info for RA }
  35.  
  36. InitRA;
  37.  
  38.       { Initialize the door }
  39.  
  40. With GlobalInfo Do
  41.  Begin
  42.  Foss.AssignF(ComPort-1,BaudRate);   { Init the fossil }
  43.  If Foss.Error<>0
  44.     Then Begin
  45.          WriteLn(#254' Couldn''t initialize fossil!');
  46.          LogIt('Couldn''t init fossil!');
  47.          Halt;
  48.          End;
  49.  
  50.  Foss.InitTimer(    { Init the timeout procedures              }
  51.                 3,  { Warning before pushed back to the BBS    }
  52.                 3   { Timeout time before and between warnings }
  53.                 );
  54.  
  55.  
  56.  Foss.InitOutputFilter(UsedFilter); { Set the output filter            }
  57.  Foss.InitInputFilter(FileCharSet); { Set the input filter for ReadLnF }
  58.  
  59.  Foss.InitSysopKeys(SysopKeys);     { Set the SYSOP keys procedure     }
  60.  Foss.InitStatLine(StatusLine);     { Set the statusline procedure     }
  61.  
  62.      { Initialize the output filter using the info in the GlobalInfo record}
  63.  
  64.  InitUsedFilter(UseGraphics,UseAVATAR,LeftBracket,RightBracket,'^');
  65.  End;
  66.  
  67.  
  68.      { Initialize the colortable, I use only these colors in ALL my programs}
  69.  
  70. ColorTable[0]:=LightCyan;           { Normal text color            }
  71. ColorTable[1]:=LightRed;            { Hotkey's and lines           }
  72. ColorTable[2]:=White;               { Userinput and info highlight }
  73. ColorTable[3]:=Yellow;              { Info                         }
  74. ColorTable[4]:=(Blue Shl 4)+White;  { Statusline color             }
  75.  
  76.      { Initialize the Fossil strings }
  77.  
  78. PressENTERString:='^0Press ^[^1ENTER^0^] to continue:';
  79.  
  80.      { Initialize the EDITOR strings. }
  81.  
  82. StatLine   := '^4^!'+Center('-=( Type your text now, use an empty line to finish )=-')+'^0';
  83. MenuLine   := '   ^0^[^1L^0^]ist      ^0^[^1C^0^]ontinue      ^[^1S^0^]ave      ^[^1A^0^]bort';
  84. YourChoice := '   ^0Your choice: ^2';
  85. Counter    := '^1@^ 2] ^0';
  86. MenuKeys   := 'ALCS';
  87.  
  88. {----------------------------------------------------------------------------|
  89.   The mainbody of the DOOR goes here.
  90. |----------------------------------------------------------------------------}
  91.  
  92. New(Body);
  93. If Body=Nil
  94.    Then Begin
  95.         Foss.WriteLnF('^1 Not enough memory!!^0');
  96.         Foss.CloseF;
  97.         Exit;
  98.         End;
  99.  
  100. FillChar(Body^,SizeOf(Body^),#00);
  101.  
  102.     { You can add text, quote from a message and such.. }
  103.  
  104. Lines:=2;
  105. Body^[0]:='* This is the BBSeditor demo:';
  106. Body^[1]:='';
  107.  
  108. LineEditor(Foss,Body,Lines,30);
  109. Foss.WriteLnF('');
  110. If Lines=0
  111.    Then Foss.WriteLnF('Text aborted...')
  112.    Else Foss.WriteLnF('Text saved...');
  113.  
  114.     { Dispose the Editor buffer and free memory }
  115.  
  116. Dispose(Body);
  117.  
  118.     { Close the fossil and leave the demo }
  119.  
  120. Foss.CloseF;
  121. End.
  122.