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
Wrap
Pascal/Delphi Source File
|
1994-12-27
|
3KB
|
73 lines
(* WHICHBBS.PAS -- A simple demonstration of how easy it is to create a
fully functional door with the FKFOSSIL unit. *)
Uses FKFOSSIL; { Include library }
VAR Input : String;
Ch : Char;
Function Str2i(S:String):LongInt; { Convert string }
Var l:LongInt;
i:Integer;
BEGIN
Val(S,l,i);
Str2i:=l;
END;
BEGIN
if ParamCount < 2 then { Check for Parameters }
BEGIN
Writeln('WHICHBBS v1.02 - Select BBS Software to Run');
Writeln('Syntax: WHICHBBS [port] [bps] [#choices]');
Halt(0);
END;
{ Initialize Fossil }
fk_InitFossil(str2i(Paramstr(1)),str2i(Paramstr(2)),str2i(Paramstr(2)),'','',300,0,25);
if fk_Host.Error = 0 then { If successful, then... }
BEGIN
fk_ClrScr;
if fk_DetectANSI then BEGIN { Check for ANSI }
if fk_DetectAvatar then { Check for AVATAR }
BEGIN
fk_Client.Screentype := 2;
fk_Writeln('Avatar Detected.',1);
END
else
BEGIN
fk_Client.Screentype := 1;
fk_Writeln('ANSI Detected.',1);
END;
END
else fk_Writeln('ANSI Not Detected.',1);
Repeat
fk_Displayfile('WHICHBBS'); { Display Menu File }
if fk_Host.Error = 9 then
BEGIN
fk_Writeln('Menu file not found. Please inform SysOp.',1);
END;
fk_TextColor(9); { Display Prompt }
fk_Writeln('',1);
fk_Write('Your selection (0=Quit/Logoff): ');
fk_TextColor(11);
fk_Host.ValidInput:='1234567890'; { Input Restrictions }
Input:=fk_Readln(3,false); { Get Input }
fk_writeln('',1);
if str2i(Input) = 0 then
BEGIN
fk_Write('Verify decision to Quit/Logoff? [No]: ');
Repeat
Ch := Upcase(fk_Read);
Until (Ch = 'Y') OR (Ch = 'N') OR (Ch = #13);
if Ch <> 'Y' then BEGIN
Input:='999';
fk_Writeln('No',2);
END
else
fk_Writeln('Yes',2);
END;
Until (Str2i(Input) < 255) AND (str2i(Input) <= str2i(Paramstr(3)));
fk_Host.ExitCode:=str2i(Input); { Set errorlevel exit }
fk_DeInitFossil; { Close Fossil, exit }
END;
END.