home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 06 / tricks / condemo.c < prev    next >
C/C++ Source or Header  |  1990-03-08  |  2KB  |  75 lines

  1. /* ------------------------------------------------------ */
  2. /*                     CONDEMO.C                          */
  3. /*    Beispielprogramm für die Funktionen aus CONIO2.C    */
  4. /*          (c) 1989 Michael Rother & TOOLBOX             */
  5. /* ------------------------------------------------------ */
  6. #include <stdio.h>
  7. #include "conio2.h"
  8.  
  9. void testbild(void)
  10. {
  11.   int i;
  12.   for (i=1;i<=24;i++) {
  13.     gotoxy(1,i);
  14.     printf("1234567890        20        30        40"\
  15.            "        50        60        70        80");
  16.   }       /* jeweils 9 Leerzeichen zwischen den Zahlen    */
  17.   getch();
  18. }
  19.  
  20. void main(void)
  21. {
  22.   short i, x, y;
  23.  
  24.   testbild();
  25.   clrscr();
  26.   printf("Bildschirm gelöscht mit 'clrscr()'.\n");
  27.   getch();
  28.   testbild();
  29.   gotoxy(1,10);
  30.   puts("Nun hier mit 'gotoxy(1,10)'.\n");
  31.   getch();
  32.   gotoxy(50,12);
  33.   puts("Nun hier mit 'gotoxy(50,12)'.\n");
  34.   getch();
  35.   clrscr();
  36.   testbild();
  37.   gotoxy(5,10);
  38.   clreol();
  39.   gotoxy(5,11);
  40.   printf("'clreol()' ab Spalte 5.");
  41.   getch();
  42.   gotoxy(50,14);
  43.   clreol();
  44.   gotoxy(50,15);
  45.   printf("'clreol()' ab Spalte 50.");
  46.   getch();
  47.   clrscr();
  48.   for (i=1; i<=24; i++) {
  49.     gotoxy(1, i);
  50.     printf("Zeile %d ist hier zu sehen", i);
  51.   }
  52.   getch();
  53.   gotoxy(1,12);
  54.   delline();
  55.   gotoxy(1,25);
  56.   printf("Die Zeile 2 wurde mit 'delline()' entfernt.");
  57.   getch();
  58.   gotoxy(1,25);
  59.   insline();
  60.   printf("Eine neue Zeile 2 wurde mit");
  61.   printf("'insline()' eingefügt.");
  62.   getch();
  63.   clrscr();
  64.   gotoxy(10,10);
  65.   x = wherex();
  66.   y = wherey();
  67.   printf("Es wurde soeben 'gotoxy(10,10)'");
  68.   printf(";aufgerufen und abgefragt.");
  69.   gotoxy(1,24);
  70.   printf("Der Wert von x war %d und von y war es %d.",x,y);
  71.   getch();
  72. }
  73. /* ------------------------------------------------------ */
  74. /*               Ende von CONDEMO.C                       */
  75.