home *** CD-ROM | disk | FTP | other *** search
- /* ------------------------------------------------- */
- /* DEMO.C */
- /* (C) 1991 Georg Pohl & DMV-Verlag */
- /* Sprache: Turbo C(++), Borland C++ */
- /* Testprogramm für den Fortschrittsgraphen. Es wer- */
- /* den die Routinen aus BAR.C und BARS.C verwendet. */
- /* ------------------------------------------------- */
-
- #pragma argsused
-
- #include <dos.h>
- #include <stdio.h>
- #include <alloc.h>
- #include <conio.h>
- #include "bar.h"
-
- char *buf;
- char far *screen;
-
- void change_screen(void)
- {
- register n;
- int seg;
-
- buf = (char *)malloc(4001);
- gettext(1, 1, 80, 25, buf);
-
- seg = peekb(0x40, 0x49) == 7 ? 0xB000 : 0xB800;
- screen = (char *) MK_FP(seg, 0);
-
- for (n = 1; n < 4000; n += 2)
- *(screen + n) = RED + (LIGHTGRAY << 4);
- }
-
-
- void main(void)
- {
- long n, m;
- BAR *bar;
-
- change_screen();
-
- copyfile("C:\COMMAND.COM", "$$$$$$$$.$$$");
-
- bar = init(" Test zum Zählen ",
- NOTEXT,
- "Es wird von 1 bis 100.000 gezählt",
- UNKNOWN,
- DO);
- time_diff = 2L;
-
- for (n = 1L; n <= 1000L; n++)
- for (m = 1L; m <= 100L; m++)
- show_bar(bar, n);
-
- bar = done(bar);
-
- while (kbhit())
- getch();
-
- printf("Weiter mit beliebiger Taste ... ");
- getch();
- puttext(1,1, 80, 25, buf);
- free(buf);
- }
-
- /* ------------------------------------------------- */
- /* Ende von DEMO.C */