home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
EVENTS
/
20QS.ZIP
/
20QS.PAS
next >
Wrap
Pascal/Delphi Source File
|
1988-03-10
|
6KB
|
195 lines
PROGRAM Questions ( input, output, Title, Ansrs );
{This is a quetionair program designed for WWIV using
Turbo 3.1 A. This questionair will allow to ask as many
questions as you want. Consider it an improved voting
board. It will allow for 75 char length answers.
Written By : White Knight (Rob Kelley)}
{$V-} {$C-}
{$I-}
{$I Common.Pas}
CONST
MustAnswer = 20; {How many questions that the user must enter
answers for, and not skip.}
MaxQuestions = 20; {Amount of Questions asked by questionair}
FileName = 'Ansrs.Msg';
TYPE
Storage = ARRAY [1..MaxQuestions] OF Str;
VAR
Title, {Welcome Screen.}
Ansrs : text; {File into which answers are stored.}
Q, {Array stores Questions}
Answer : Storage; {Array stores Answers}
Again : Boolean; {Ask Question in main line}
PROCEDURE RETURN; {- - - Return to BBS - - -}
VAR
F: file;
BEGIN
ASSIGN ( F, 'bbs.com' );
print ('Thank You so much, C-Ya .....'); {Returning Message}
remove_port;
IF ( HangUp ) THEN
term_ready( False );
execute ( F );
END;
PROCEDURE Welcome;
BEGIN
CLS; {Clears Screen}
PrintFile ('Title.Dat'); {Prints out file Title.Msg}
Nl; Nl; Nl; {Prints out three blank lines}
PauseScr; {Waits for key to be pressed to cont}
CLS; {Clears Screen}
Nl;Nl;Nl;Nl;Nl; {Prints out five blank lines}
END;
PROCEDURE ReadyFile;
VAR
Buffer : char;
BEGIN
assign (Ansrs, FileName);
if IOresult <> 0 then
Begin
ReWrite(ansrs);
WriteLn(ansrs,'');
close(ansrs);
End;
Append(ansrs);
sysoplog( '- - Used The Questionairre. - -' );
writeln ( Ansrs, Nam );
{$I+}
END;
Function GetAnswer ( Number : integer ) : Str;
Const
AnswerLength = 75;
VAR
Prefix,
Respond,
TryAgain, respond1 : Str;
BEGIN
Prefix := '?: ';
Respond := 'It is important that you answer this Question.';
TryAgain := 'Enter the Answer at this time.';
REPEAT
prompt (Prefix);
InputL ( Respond1, AnswerLength );
IF ( ( Number <= MustAnswer ) AND ( respond1 = '') ) THEN
BEGIN
print (Respond);
print (TryAgain);
END;
CheckHangUp;
UNTIL ( ( Number > MustAnswer ) OR ( respond1<> '' ) );
Nl;
GetAnswer:=respond1;
END;
PROCEDURE Questions (VAR Q : Storage);
{Place your questions here. If you desire more than 20 questions you
will have to add them. Else, just enter the questions you will be
using and ignore the others.}
BEGIN
Q [1] := 'What is your FULL REAL name?';
Q [2] := 'What is your VOICE PHONE #?';
Q [3] := 'What is your DATA PHONE #?';
Q [4] := 'What is your ADDRESS?';
Q [5] := 'What is your CITY, STATE, ZIP CODE?';
Q [6] := 'What is your MAX BAUD rate?';
Q [7] := 'What COMM SOFTWARE are you useing?';
Q [8] := 'Isn''t this fun, there''s still more?';
Q [9] := 'What type of COMPUTER do you use?';
Q [10] := 'Do you run a BBS?';
Q [11] := 'If so, What''s the name and #?';
Q [12] := '8 more to go, can you make it?';
Q [13] := 'Why do you want access to the GAMEZONE, line 1 of 3';
Q [14] := 'Why do you want access to the GAMEZONE, line 2 of 3';
Q [15] := 'Why do you want access to the GAMEZONE, line 3 of 3';
Q [16] := 'Trick Question, What do you think ABC stands for?';
Q [17] := 'What do you want to get from this BBS?';
Q [18] := 'What BBS''s do you call and what hours?';
Q [19] := 'Comments to the SysOp go here???';
Q [20] := 'More Comments please??????????';
END;
PROCEDURE Ask ( VAR Q, Answer : Storage );
VAR
Loop : integer;
Result : Str;
BEGIN
print ('INFO.msg');
nl;nl;nl;
FOR Loop := 1 TO MaxQuestions DO BEGIN
Nl;
print ( Q [Loop] );
Answer[Loop] := GetAnswer ( Loop );
CheckHangUp;
END;
END;
PROCEDURE SendToFile (Answer : Storage);
VAR
Loop : integer;
BEGIN
ReadyFile;
{writeln (Ansrs, Buffer);}
FOR Loop := 1 TO MaxQuestions DO BEGIN
IF ( Answer [Loop] = '' ) THEN
Answer [Loop] := ' ';
writeln (Ansrs, Answer [Loop] );
END;
Close (Ansrs);
END;
PROCEDURE OnceMore (VAR Again : boolean);
VAR
Hmmm,
Mark : str;
What : char;
BEGIN
Hmmm := 'Would you like to re-enter your Answers (Y/N)? ';
Mark:= '?: ';
Nl;Nl;Nl;
print ( Hmmm );
Prompt ( Mark );
REPEAT
GetKey ( What );
UNTIL ( What IN ['Y', 'y', 'N', 'n'] );
IF ( ( What= 'Y' ) OR (What= 'y' ) ) THEN
Again := true
ELSE
Again := false;
END;
BEGIN {MainLine}
iport;
REPEAT
Welcome;
{writeln('going into questions');}
Questions ( Q );
Ask ( Q, Answer );
OnceMore ( Again );
CheckHangUp;
UNTIL ( Again = FALSE );
SendToFile ( Answer );
RETURN;
END.