home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / GENUTIL / FKFOS102.ZIP / SAMPLES.ZIP / WHBBS102.ZIP / WHICHBBS.PAS < prev   
Pascal/Delphi Source File  |  1994-12-27  |  3KB  |  73 lines

  1. (* WHICHBBS.PAS  -- A simple demonstration of how easy it is to create a
  2.                     fully functional door with the FKFOSSIL unit.          *)
  3.  
  4. Uses FKFOSSIL;                                            { Include library }
  5.  
  6. VAR Input : String;
  7.     Ch    : Char;
  8.  
  9. Function Str2i(S:String):LongInt;                         { Convert string }
  10. Var l:LongInt;
  11.     i:Integer;
  12. BEGIN
  13.   Val(S,l,i);
  14.   Str2i:=l;
  15. END;
  16.  
  17. BEGIN
  18. if ParamCount < 2 then                               { Check for Parameters }
  19.    BEGIN
  20.    Writeln('WHICHBBS v1.02 - Select BBS Software to Run');
  21.    Writeln('Syntax: WHICHBBS [port] [bps] [#choices]');
  22.    Halt(0);
  23.    END;
  24.                                                         { Initialize Fossil }
  25. fk_InitFossil(str2i(Paramstr(1)),str2i(Paramstr(2)),str2i(Paramstr(2)),'','',300,0,25);
  26. if fk_Host.Error = 0 then                          { If successful, then... }
  27.    BEGIN
  28.    fk_ClrScr;
  29.    if fk_DetectANSI then BEGIN                             { Check for ANSI }
  30.                          if fk_DetectAvatar then         { Check for AVATAR }
  31.                             BEGIN
  32.                             fk_Client.Screentype := 2;
  33.                             fk_Writeln('Avatar Detected.',1);
  34.                             END
  35.                          else
  36.                             BEGIN
  37.                             fk_Client.Screentype := 1;
  38.                             fk_Writeln('ANSI Detected.',1);
  39.                             END;
  40.                          END
  41.                     else fk_Writeln('ANSI Not Detected.',1);
  42.    Repeat
  43.    fk_Displayfile('WHICHBBS');                          { Display Menu File }
  44.    if fk_Host.Error = 9 then
  45.       BEGIN
  46.       fk_Writeln('Menu file not found.  Please inform SysOp.',1);
  47.       END;
  48.    fk_TextColor(9);                                        { Display Prompt }
  49.    fk_Writeln('',1);
  50.    fk_Write('Your selection (0=Quit/Logoff): ');
  51.    fk_TextColor(11);
  52.    fk_Host.ValidInput:='1234567890';                   { Input Restrictions }
  53.    Input:=fk_Readln(3,false);                                   { Get Input }
  54.    fk_writeln('',1);
  55.    if str2i(Input) = 0 then
  56.       BEGIN
  57.       fk_Write('Verify decision to Quit/Logoff? [No]: ');
  58.       Repeat
  59.       Ch := Upcase(fk_Read);
  60.       Until (Ch = 'Y') OR (Ch = 'N') OR (Ch = #13);
  61.       if Ch <> 'Y' then BEGIN
  62.                         Input:='999';
  63.                         fk_Writeln('No',2);
  64.                         END
  65.                         else
  66.                         fk_Writeln('Yes',2);
  67.       END;
  68.    Until (Str2i(Input) < 255) AND (str2i(Input) <= str2i(Paramstr(3)));
  69.    fk_Host.ExitCode:=str2i(Input);                    { Set errorlevel exit }
  70.    fk_DeInitFossil;                                    { Close Fossil, exit }
  71.    END;
  72. END.
  73.