home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / ML-MOD.ZIP / MLFRAME.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-04-10  |  8.8 KB  |  227 lines

  1. {$A+,B-,D-,E-,F-,I-,L-,N-,O-,R-,S+,V-}
  2. {$M 10000,10000,10000}
  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. {---------------------------------------------------------------------------|
  20.  
  21.  Description:
  22.  
  23.  MLFrame is a simple framework for a door written with the RADoor toolbox.
  24.  It has the main initializations already where they should, and the important
  25.  variables in place. Simply stuff some code at the spot marked X and compile.
  26.  that's all. Compiling this frame without anything further code and the
  27.  compiler toggles as above resulted in an EXE file with the following values
  28.  in the Get Info window of TP5.5:
  29.  
  30.     CodeSize   30720 bytes
  31.     DataSize   25652 bytes
  32.  
  33.  Not too much for an all singing, all dancing door featuring everything a door
  34.  should feature!
  35. }
  36.  
  37.  
  38. Program MLframe;
  39. Uses DOS,
  40.      CRT,
  41.      BBSTypes,   { BBS detection routine                         }
  42.      UserHook,   { Demo/default userhook procedures              }
  43.      Language,   { The multilanguage support                     }
  44.      MLFilter,   { The default Multilanguage output filter       }
  45.      LowLevel,   { The lowlevel stuff                            }
  46.      DoorSys,    { Misc. Door routines.                          }
  47.      GlobInfo,   { the global record with all the nessecary info }
  48.  
  49.      RA,         { The RA init code                              }
  50.      SuperBBS,   { The SBBS init Code                            }
  51.      QuickBBS,   { the QBBS init Code                            }
  52.  
  53.      Fossil;     { The fossil routines + Timing. This is the     }
  54.                  {  body of the door!                            }
  55.  
  56.  
  57. {----------------------------------------------------------------------------|
  58.   The name and the version of the program together with the FossilObject
  59.   variable which every door needs.
  60. |----------------------------------------------------------------------------}
  61.  
  62.  
  63. Const  ProgramName    = 'MLframe';
  64.        ProgramVersion = '1.0';
  65.        LastUpdate     = '4 Sep 1992';
  66.        ProgName       = 'MLFrame';
  67.  
  68. Var Foss       : FossilObject;
  69.     Slang      : String[3];
  70.  
  71.  
  72. {----------------------------------------------------------------------------|
  73.  Start here your own variables, procedures and functions.
  74. |----------------------------------------------------------------------------}
  75.  
  76.  
  77.  
  78. {----------------------------------------------------------------------------|
  79.  Start of main module
  80. |----------------------------------------------------------------------------}
  81. Begin
  82.  
  83. WriteLn(ProgramName,' ',ProgramVersion,' (c) LiveSystems 1992,1993   ALL RIGHTS RESERVED,  NO GUARANTEES');
  84. WriteLn('Written by G.Hoogterp. E-mail address 2:283/1.2 Last Revision '+LastUpdate);
  85. WriteLn('Use ??.EXE -? to see commandline parameter summary.');
  86.  
  87. If ExistParameter('?')
  88.    Then Begin
  89.         WriteLn('Usage: ');
  90.         WriteLn;
  91.         WriteLn(' ??.EXE [-T:<TimeLimit>] [-N:*N] [-P:*P] [-NOS]');
  92.         WriteLn;
  93.         WriteLn(' -T:     Set timelimit.');
  94.         WriteLn(' -N:     Give nodenumber for multiline setups.');
  95.         WriteLn(' -P:     Give ComPort to use.');
  96.         WriteLn(' -NOS    No sound please');
  97.  
  98.         Halt;
  99.         End;
  100.  
  101. { The parameters mentioned here are read in the RA.PAS unit as they are more
  102.   or less RA dependend and the result has to be stuffed into the global info
  103.   record. }
  104.  
  105. {----------------------------------------------------------------------------|
  106.  Grab the BBS specific stuff into the GlobalInfo record
  107. |----------------------------------------------------------------------------}
  108.  
  109. Case CurrentBBStype Of
  110.  RA_BBS : InitRA;
  111.  S_BBS  : InitSBBS;
  112.  Q_BBS  : InitQBBS;
  113. End;
  114.  
  115.  
  116. Slang:=GlobalInfo.Language;
  117.  
  118. If Not ExistFile(GlobalInfo.HomeDir+ProgName+'.'+Slang)
  119.    Then Begin
  120.         If Not ExistFile(GlobalInfo.HomeDir+ProgName+'.ENG')
  121.            Then Begin
  122.                 LogIt('Couldn''t find language file..');
  123.                 WriteLn(#254' Couldn''t find language file..');
  124.                 Halt;
  125.                 End
  126.            Else Slang:='ENG';
  127.         End;
  128.  
  129.  
  130. {----------------------------------------------------------------------------|
  131.  And let the LOGfile know who's talking.
  132. |----------------------------------------------------------------------------}
  133.  
  134. LogIt('Started: '+ProgramName+' '+ProgramVersion+' under '+GlobalInfo.BBSName);
  135.  
  136. {----------------------------------------------------------------------------|
  137.   Initialize the userhooks, Timeout detection etc.
  138. |----------------------------------------------------------------------------}
  139.  
  140. With GlobalInfo Do
  141.  Begin
  142.  Foss.AssignF(ComPort-1,BaudRate);   { Inti the fossil }
  143.  If Foss.Error<>0
  144.     Then Begin
  145.          WriteLn(#254' Couldn''t initialize fossil!');
  146.          LogIt('Couldn''t init fossil!');
  147.          Halt;
  148.          End;
  149.  
  150.  Foss.InitTimer(    { Init the timeout procedures              }
  151.                 GlobalInfo.Warnings,     { Warning before pushed back to the BBS    }
  152.                 GlobalInfo.TimeOutTime   { Timeout time before and between warnings }
  153.                 );
  154.  
  155.  
  156.  Foss.InitOutputFilter(UsedFilter); { Set the output filter            }
  157.  Foss.InitInputFilter(AllCharSet);  { Set the input filter for ReadLnF }
  158.  
  159.  Foss.InitSysopKeys(SysopKeys);     { Set the SYSOP keys procedure     }
  160.  Foss.InitStatLine(StatusLine);     { Set the statusline procedure     }
  161.  
  162.  { Initialize the output filter using the info in the GlobalInfo record}
  163.  
  164.  InitUsedFilter(UseGraphics,UseAVATAR,GlobalInfo.HomeDir+ProgName+'.'+Slang,'^');
  165.  End;
  166.  
  167.  
  168. { Initialize the colortable, I only use these colors in ALL my programs}
  169.  
  170. Move(Specials.Colors,ColorTable,10);
  171.  
  172. PressEnterString       := ']001';
  173. PressEnterOrStopString := ']002';
  174. Warning1String         := ']004';
  175. Warning2String         := ']005';
  176. AttentionString        := ']006';
  177. LockOutString          := ']007';
  178. HangUpString           := ']008';
  179. TimeUpString           := ']009';
  180. UsedStopKey            := Specials.StopDef;
  181.  
  182. {----------------------------------------------------------------------------|
  183.   The mainbody of the DOOR goes here.
  184. |----------------------------------------------------------------------------}
  185.  
  186.  
  187.  
  188.  
  189. {----------------------------------------------------------------------------|
  190.   Finalize the DOOR and say a nice thank you to the user for spending his
  191.   online time and money on your door..
  192. |----------------------------------------------------------------------------}
  193.  
  194. Case GlobalInfo.BBSTag Of
  195.  RABBS : If Not RAUpdateExitInfo
  196.             Then LogIt('Couldn''t update the EXITINFO.BBS!');
  197.  SBBS  : If Not SBBSUpdateExitInfo
  198.             Then LogIt('Couldn''t update the EXITINFO.BBS!');
  199.  QBBS  : If Not QBBSUpdateExitInfo
  200.             Then LogIt('Couldn''t update the EXITINFO.BBS!');
  201.  
  202. End;
  203.  
  204. Foss.ClrScrF;  { Clear the screen }
  205. Foss.WriteLnF(']010'+ProgramName+' '+ProgramVersion+'.');
  206. Delay(1000);
  207.  
  208. {----------------------------------------------------------------------------|
  209.   Tell the LogFile that we're finished. Gives the fossil some extra time
  210.   to get the ThankYou out of it's mouth....
  211. |----------------------------------------------------------------------------}
  212.  
  213. LogIt('Stopped: '+ProgramName+' '+ProgramVersion);
  214.  
  215. {----------------------------------------------------------------------------|
  216.  And close the fossil again..
  217. |----------------------------------------------------------------------------}
  218.  
  219. Foss.CloseF;
  220. End.
  221.  
  222. {----------------------------------------------------------------------------|
  223.    And that's it! That's all.. I can't make things simpler..
  224.    Oh well, actualy I could, but not without giving up flexability and
  225.    usability.....
  226. |----------------------------------------------------------------------------}
  227.