home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
TGARTS.ZIP
/
SAMPLE.ZIP
/
TGVOTE.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1998-12-20
|
1KB
|
60 lines
Program New;
Uses Crt;
{$I telegard.inc}
VAr Vote_file : file of voterec;
Vote_Rec : Voterec;
Bull_file : text;
Vote_data : Array[1..numvoteqs] of voterec;
Total_Rec : Byte;
Loop,loop2 : Byte;
Temp,Adesc : String;
Procedure read_data;
Var Cnt : Byte;
Begin
Clrscr; Cnt := 0;
Assign(Vote_file,'voting.dat');
Reset(Vote_file);
While not eof(vote_file) do
Begin
Inc(Cnt);
Read(vote_file,vote_rec);
Vote_data[Cnt]:= vote_rec;
end;
Close(Vote_file);
end;
Begin
Read_data;
For Loop := 1 to 20 do
Begin
Vote_rec := vote_data[loop];
If vote_rec.active then
Begin
Assign(bull_file,'Vote'+chr(64+loop)+'.msg');
Rewrite(bull_file);
Writeln(Bull_file,'`0A Bulltin of Voting results');
Writeln(Bull_file);
Writeln(Bull_file,'`0Bfor '+vote_rec.question);
str(vote_rec.numusers,temp);
Writeln(bull_file,'`0Ethere were '+temp+' users who voted on this question.');
For loop2 := 1 to vote_rec.numans do
Begin
adesc := vote_rec.answer[loop2].desc;
Writeln(bull_file,'`0F Answer:'+adesc);
str(vote_rec.answer[loop2].numres,temp);
Writeln(Bull_file,'`0F Votes:'+temp);
end;
Close(Bull_file);
end;
end;
Textcolor(14);
Writeln('Bulletins were generated. Look for Vote?.msg');
Writeln('Where ? is a letter from A-T.');
end.