home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 12
/
CD_ASCQ_12_0294.iso
/
news
/
2410
/
mgspell2
/
demo.c
next >
Wrap
C/C++ Source or Header
|
1993-12-07
|
4KB
|
174 lines
/* ┌──────────────────────────────────────────────────────────────────┐
│ MicroGenesis Spell V1.4 │
│ │
│ Copyright 1991 by Jeff Heaton │
│ │
│ Source code may not be distributed in any form. │
│ │
└──────────────────────────────────────────────────────────────────┘ */
#include <stdio.h>
#include <conio.h>
#if defined(M_I86)
#include <graph.h>
#endif
#define SHAREWARE
#include "mgspell.h"
void grab_word(FILE *fp,char *word);
//extern char suggest[10][30];
/************ MUST COMPILE UNDER SMALL MEMORY MODEL ***********************/
void clear(void);
void title(void);
void press(void);
void main(void);
void clear(void)
{
#if defined(M_I86)
/*(_GCLEARSCREEN);*/
#endif
#if defined(__TURBOC__)
clrscr();
#endif
}
void title(void)
{
clear();
printf("MGSpell Demo V2.0(C Version)\n\r");
printf("Copyright 1990,1991 by Jeff Heaton");
}
void press(void)
{
printf("\r\n\n<Press any key>");
getch();
}
void main(void)
{
FILE *fp;
char test[80];
int d1,d2;
char ch;
reg("");
for(;;)
{
title();
printf("\r\n\r\n");
printf("\r\nWords defined:%ld",word_count());
printf("\r\n\r\n [1] Search for word.\n\n\r");
printf(" [2] Add Word to User Dictionary\n\n\r");
printf(" [3] Merge User & Main Dictionary");
#ifdef SHAREWARE
printf("(Registered Version Only)");
#endif
printf("\n\n\r");
printf(" [4] Dump Dictionary To ASCII File");
#ifdef SHAREWARE
printf("(Registered Version Only)");
#endif
printf("\n\n\r");
printf(" [5] Quit Program\r\n\nOption>");
ch=getch();
switch(ch)
{
case '1':
title();
printf("\r\n\r\nSearch for>");
gets(test);
if(spell_check(test))
{
char s1[80],s2[80],s3[80],s4[80],s5[80],s6[80],s7[80],s8[80],s9[80],s10[80];
printf("\nWord NOT defined:\n\n");
suggest_word(test);
suggestion(s1,s2,s3,s4,s5,s6,s7,s8,s9,s10);
printf("%s\n",s1);
printf("%s\n",s2);
printf("%s\n",s3);
printf("%s\n",s4);
printf("%s\n",s5);
printf("%s\n",s6);
printf("%s\n",s7);
printf("%s\n",s8);
printf("%s\n",s9);
printf("%s\n",s10);
}
else printf("\nWord is defined");
press();
break;
case '2':
title();
printf("\r\n\r\nAdd>");
gets(test);
if(add_word(test))
printf("Disk ERROR - Word NOT added\r\n");
else printf("Word Added.\r\n");
press();
break;
#ifndef SHAREWARE
case '3':
title();
printf("\r\n\r\nThis feature takes several minutes to complete\r\n");
printf("Working....");
import();
press();
break;
case '4':
title();
printf("\r\n\r\nOutput to what file>");
gets(test);
printf("\r\n\r\nThis feature takes several minutes to complete\r\n");
printf("Working....");
if(dump(test))
printf("Disk ERROR");
else printf("Done.");
press();
break;
#endif
case '5':
clear();
exit(0);
default:
putch('\7');
}
}
}