home *** CD-ROM | disk | FTP | other *** search
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
- #define pr(x) fprintf(fp,x)
- /* */
- main(int argc,char *argv[])
- {
- FILE *fp;
- if(argc<2)
- return;
- system("cls");
- cursor(12,20);
- color_puts("╒²╘┌╔·│╔╚½▓┐Σ»└└,╟δ╔╘║≥!",14);
- fp=fopen("lookall.prg","w");
- pr("set talk off\ndo while .t.\n clear\n");
- pr("set color to w+/B\n@0,0 say '╚½▓┐Σ»└└'\n");
- pr("@2,26 say '╟δ╤í╘±─·╨Φ▓┘╫≈╡─┐Γ'\n");
- pr("@3,26 say '~~~~~~~~~~~~~~~~~~'\n");
- pr("name=''\nflag=0\ncoflag=' '\n") ;
- pr("set color to W+/B\n");
- pr("do dbfmenu with name, flag, coflag\n");
- pr("if name='0'\n");
- pr("return\n");
- pr("endif\n");
- fprintf(fp,"name=coflag+name+'.dbf'\n");
- fprintf(fp,"run %sbrow &name\nclear\n @24,0 say space(80)\n enddo\n",argv[1]);
- pr("return\n");
- fclose(fp);
- }
-
-
-
-
-
- cursor(y,x)
- int x,y;
- { union REGS inregs;
- union REGS outregs;
- inregs.h.ah=2;
- inregs.h.bh=0;
- inregs.h.dh=y;
- inregs.h.dl=x;
- int86(0x10,&inregs,&outregs);
- }
-
-
-
- color_puts(s,color)
- char *s;
- int color;
- { union REGS r;
- int x,y,z;
- now_cursor(&x,&z);
- y=z;
- while (*s)
- { if (*s=='\n')
- { s++;
- x++;
- y=z;
- continue;
- }
- cursor(x,y);
- r.h.ah=9;
- r.h.al=*s++;
- r.h.bl=color;
- r.h.bh=0;
- r.x.cx=1;
- int86(0x10,&r,&r);
- y++;
- cursor(x,y);
- }
- return;
- }
-
-
- now_cursor(x,y)
- int *x,*y;
- { union REGS r;
- r.h.ah=3;
- r.h.bh=0;
- int86(0x10,&r,&r);
- *x = r.h.dh;
- *y = r.h.dl;
- return;
- }