home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a014 / 1.ddi / CDBINC.EXE / SUB9.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-18  |  1.5 KB  |  87 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <dos.h>
  5. #define pr(x) fprintf(fp,x)
  6. /*   */
  7. main(int argc,char *argv[])
  8. {
  9.   FILE *fp;
  10.   if(argc<2)
  11.     return;
  12.   system("cls");
  13.   cursor(12,20);
  14.   color_puts("╒²╘┌╔·│╔╚½▓┐Σ»└└,╟δ╔╘║≥!",14);
  15.   fp=fopen("lookall.prg","w");
  16.   pr("set talk off\ndo while .t.\n clear\n");
  17.   pr("set color to w+/B\n@0,0 say '╚½▓┐Σ»└└'\n");
  18.   pr("@2,26 say '╟δ╤í╘±─·╨Φ▓┘╫≈╡─┐Γ'\n");
  19.   pr("@3,26 say '~~~~~~~~~~~~~~~~~~'\n");
  20.   pr("name=''\nflag=0\ncoflag=' '\n")    ;
  21.   pr("set color to W+/B\n");
  22.   pr("do dbfmenu with name, flag, coflag\n");
  23.   pr("if name='0'\n");
  24.   pr("return\n");
  25.   pr("endif\n");
  26.   fprintf(fp,"name=coflag+name+'.dbf'\n");
  27.   fprintf(fp,"run %sbrow &name\nclear\n @24,0 say space(80)\n enddo\n",argv[1]);
  28.   pr("return\n");
  29.   fclose(fp);
  30. }
  31.  
  32.  
  33.  
  34.  
  35.  
  36. cursor(y,x)
  37. int x,y;
  38. {  union REGS inregs;
  39.    union REGS outregs;
  40.    inregs.h.ah=2;
  41.    inregs.h.bh=0;
  42.    inregs.h.dh=y;
  43.    inregs.h.dl=x;
  44.    int86(0x10,&inregs,&outregs);
  45. }
  46.  
  47.  
  48.  
  49. color_puts(s,color)
  50. char *s;
  51. int color;
  52. {  union REGS r;
  53.    int x,y,z;
  54.    now_cursor(&x,&z);
  55.    y=z;
  56.    while (*s)
  57.      {  if (*s=='\n')
  58.       {  s++;
  59.          x++;
  60.          y=z;
  61.          continue;
  62.       }
  63.     cursor(x,y);
  64.     r.h.ah=9;
  65.     r.h.al=*s++;
  66.     r.h.bl=color;
  67.     r.h.bh=0;
  68.     r.x.cx=1;
  69.     int86(0x10,&r,&r);
  70.     y++;
  71.     cursor(x,y);
  72.      }
  73.    return;
  74. }
  75.  
  76.  
  77. now_cursor(x,y)
  78. int *x,*y;
  79. {  union REGS r;
  80.    r.h.ah=3;
  81.    r.h.bh=0;
  82.    int86(0x10,&r,&r);
  83.    *x = r.h.dh;
  84.    *y = r.h.dl;
  85.    return;
  86. }
  87.