home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MS DOS Archives 1
/
MS-DOS_Archives_Volume_One_Walnut_Creek.iso
/
msdos
/
graphics
/
hgrph101.arc
/
DEMO.C
< prev
next >
Wrap
C/C++ Source or Header
|
1989-02-25
|
2KB
|
62 lines
/* DEMO.C - a demo of hgraph.lib's string writing routines */
#include <string.h> /* for strlen() */
#include <stdlib.h> /* for gcvt() */
#include <conio.h> /* for getch() */
#include "hgraph.h" /* for the hgraph routines */
char buffer[80]; /* for use with gcvt() */
main()
{
int ct, i;
char c, *strp;
char *string = "HGRAPH.LIB";
double pi = 3.141592654;
hgraph_init();
HGPAGE = 1;
ct = strlen(string);
strp = string;
hgmode_nc();
hclearpg();
hshowpg();
hstr(40, 1, string, HGINVS, ct); /* accross */
for(i = 0; i < ct; i++) {
hstr(50, 2 + i, strp, HGINVS, 1); /* down */
hstr(49 - i, 12, strp, HGINVS, 1); /* back */
hstr(39, 11 - i, strp, HGINVS, 1); /* up */
strp++;
}
/* double line box */
hbox(1, 72, 152, 400, 192);
hbox(1, 68, 150, 404, 194);
/* text for in box */
HGATRB = HGNORM;
hwrite(20, 10, "You can write UPPER or lower case");
hwrite(22, 10, "Numbers");
gcvt( -pi, 10, buffer);
hwrite(22, 20, buffer);
/* rest of screen */
HGATRB = HGINVS;
hwrite(30, 10, "Or graphics (see COP.C)");
HGATRB = HGNORM;
hwrite(40, 10, "Press any key to continue ...");
getch();
htmode_nc();
}