Category : Files from Magazines
Archive   : ITCAPR91.ZIP
Filename : DOGDATA.C
* DOGDATA.C - Print a report on all clients, and then print all the *
* clients that have more than 5 dogs. *
* *
* To compile: "tcc dogdata doggie" *
************************************************************************/
#include
#include "doggie.h"
#define DO(x) if (x) puts("DoggieDataError: " #x)
void printHeading(char *s)
{
puts("\n\n");
puts(s);
puts("\nCust Num Customer Name dogs awards");
puts("-------- -------------------- ---- ------");
}
void main(void)
{
int x;
struct DoggieDef y;
DO(InitializeDoggieData()); /* Initialize database */
/* Print first report */
DO(StartDoggieSearch()); /* Reset database to start */
printHeading("Report on all customers");
while ( (x=GetNextRecord()) != -1 )
{
DO(GetDoggieData(x,&y));
printf(" %4d %-20.20s %2d %2d\n",
y.CustNum, y.CustName, y.NumDoggies, y.NumAwards);
}
/* Print second report */
DO(StartDoggieSearch()); /* Reset database to start */
printHeading("Report on Dog Lovers (minDogs == 5)");
while ( (x=GetNextDogLover(5)) != -1)
{
DO(GetDoggieData(x,&y));
printf(" %4d %-20.20s %2d %2d\n",
y.CustNum, y.CustName, y.NumDoggies, y.NumAwards);
}
DO(CleanupAfterDoggies());
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/