/*ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ³ File: r01.cpp Created: 5/ 4/99 º ³ from r01.cpp, at 7:10am º ³ zs.cpp, ...For building new files...... º ³ m03.cpp ...from text scanned files..... º ³ moded: 7/ 2/00 6:37am-> 7:00am 7/15/00 1:48pm-> 2:00pm º ³ ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù º ³ 6/25/02 6:30am-> 7:31am 6/25/02 9:25am-> 9:56am º ³ ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù ù º ³ 11/ 4/02 6:08am-> 6:32am 11/ 4/02 7:47am-> 8:38am º ³ 1/28/03 6:15am-> 6:40am 1/28/03 7:46am-> 9:54am º ³ 1/29/03 6:01am-> 6:44am 1/29/03 8:03am->10:48am º ³ 1/30/03 6:04am-> 6:41am 1/30/03 7:36am->10:17am º ³ 1/30/03 12:56pm-> 1:24pm 1/31/03 6:28am-> 6:48am º ³ 1/31/03 8:49am->10:20am 1/31/03 1:05pm-> 1:37pm º ³ 2/ 1/03 6:08am-> 6:46am 2/ 1/03 8:01am-> 9:36am º ³ 2/ 2/03 6:09am-> 6:37am 2/ 2/03 7:39am->10:46am º ³ 2/ 3/03 6:05am-> 6:39am 2/ 3/03 7:40am->10:44am º ³ 2/ 4/03 6:17am-> 6:36am 2/ 4/03 7:54pm->10:16pm º ³ 2/ 4/03 1:23pm-> 1:48pm 2/ 7/03 7:48am-> 8:35am º ³ 3/ 4/03 1:20pm-> 1:41pm 3/ 5/03 1:33pm-> 2:13pm º ³ 3/ 7/03 1:06pm-> 1:55pm 3/ 8/03 1:12pm-> 1:39pm º ³ 3/ 9/03 10:14am->10:33am 3/10/03 6:08am-> 6:28am º ³ 3/10/03 10:09am->10:43am 3/11/03 7:52am->10:40am º ³ 3/12/03 7:44am-> 9:08am 3/13/03 5:55am-> 6:40am º ³ 3/13/03 7:32am->10:31am 3/15/03 1:07pm-> 1:33pm º ³ 3/16/03 6:20am-> 6:27am 3/17/03 6:21am-> 6:42am º ³ 3/19/03 6:05am-> 6:33am 3/19/03 7:55am-> 7:58am º ³ 6/17/03 7:34am-> 7:53am 6/30/03 6:49am-> 7:18am º ³ 7/25/03 10:01am->11:02am 7/26/03 7:20am-> 8:20am º ³ 7/26/03 8:56am->10:33am 7/27/03 6:33am-> 7:30am º ³ 7/28/03 8:17am-> 8: am / /03 : pm-> : pm º ³ / /03 : am-> : am / /03 : pm-> : pm º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ*/ // triplex_font#1, small_font#2, sansserif_font#3, gothic_font#4 // re-modeled: 3/07/2000-> 3/12/2000 // converted ns[] var to *ns[]: 1/28/2003-> 2/ 7/2003 #include #include #include #include #include #include #include #include struct text_info tscrn; struct dostime_t hrmn; // unsigned char hour; struct find_t ffblk; extern int _wscroll; void intrvl(char *msg); void getdir(char cpf); void chgdir(char *dir, char cpf); long int gtc(char *msg, char *ch, int ff); int ansichk(char *msg, char *ch, int f1); void bordr(int wd,int ht,char ul,char ur,char lr,char ll,char hz,char vt); void prtbx(int x,int y,int xr,int yl, int clr, int clr2, char *ms); void inbox(int x,int y,int wd,int ht,int clr,char wc,int cls); void numseg(void); void sort(int i, int j, int t, int s); void ovlp(int xg, int yg, char *scs); char allc(int sub, char *rec, char seg); void copyns(char *tgt, int ndx); void recx(char seg); int calcln(char *rgn); void rsort(); void lead0(char *rslt); void numfrmt(void); void fwrd(char *chkcs); void pdir(void); void fill(char *cst, int ind); FILE *fle; int long d=0, m, cskp, cmsd, sl, lskp, lmsd; char fnme[99], buf, sinf[4][3]; int i, j, k, o, r, s, x, y, z, sint, t, w1, c, ww, b=1, n, Q=1, h=25, fc=2, gbt, Len, Lb=7, gw=2, gb, gpgm=9, gmod=2, xx, yy, ih, jh, mh, fh, rptst=1, rptln, w=1, vint, N, vr, kd, kx, kf, enm=1, yds, den, Lst, kopt=0, x1, xp, yp, et; char wrd[161], tme[13]; char blks[160]=" " " " " "; int long cnm; char *dx[802], dot1[44]="ùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùùù", dcm[50], orec[96], ccs[161] = "", mn[4], dy[4], yr[4], vdisks[44] = " disks: ", dcs[14], rtdr[4] = " :\\", List[3][10] = { "ÍÍÍÍÍÍÍÍÍ", "lower rpt", "upper rpt" }, // ssve[21][90], tcs[96], far *pad=dcm+25, far *nad, far *cad=ccs; unsigned char rptsw=0, dsc; char as[161] = "", bcs[161] = "", zcs[161] = "", xcs[161] = "", ycs[161], kmem[18][160] = { "", "a:\\", "c:\\" }, msgm[2][15] = { "", "dos ram is low" }, crdr[99] = { " :\\" }, dscs[27] = { 1, 1, 4, 8, 6, 5, 9, 10, 11, 12, 13, 14, 14, 12, 4, 6, 8, 6, 9, 10, 11, 12, 13, 14, 11, 12, 0 }, trns[9] = { "ù " }, far *fad, far *sad, rs[160], fsys='w'; int opbx, op=1, bxlc[5] = { 1, 14, 26, 40, 57 }; char opcds[5][10] = { "$i0bcxt", "$esd)( ", "$p\\rvl=", "$-Ruy2f", "$mWSwaA" }, opnms[5][7][20] = { "", " Input ", " Output ", " 1st Record ", " Last Record ", " Exit ", " Clip Portal", "", " Edit ", " Swap ", " Delete ", " Move Right ", " Move Left ", " Line Nmbrs ", "", " Position ", " Even Page ", " Search ", " Dir Report ", " Lines/Screen ", " Info Bar ", "", " Truncate Blanks ", " Re-format ", " Sort Recs ", " Interval Merge ", " Win/Mac input ", " Graph Recs ", "", " Lines move ", " Max len move ", " String move ", " Min len move ", " De-seg lines", " Seg lines " }; unsigned char Oc='=', Ec, swN=1, optsw=1, swB, Msc=0, Tsc, Ssc; int ROW=8001, COL=159; char far *ns[8002]; //=========================================================// void main() { registerbgifont(small_font); registerbgidriver(EGAVGA_driver); for (i=0;i<=801;i++) dx[i] = (char *) malloc(44); getdir(0); strcpy(ccs, crdr); for (i=0;i<27;i++) { setdisk(i); if (getdisk()==i) { buf = i + 97; sprintf(zcs, " %c", buf); if (strlen(vdisks)<=41) strcat(vdisks, zcs); } } chgdir(ccs, 0); if(_argv[1]) { strcpy(fnme, _argv[1]); fc = fc + 1; strcpy(kmem[fc], fnme); goto inptstrt; } start: textattr(112); window( 1, 1, 80, 25); // clear screen //Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä k = Q; xx = 0; for (j=Q; jROW || c==0) { cprintf("\r"); goto blnkit; } if (k=80) { j = j + 1; xx = xx + 1; } } blnkit: clreol(); endlp: if (j==Q+24) _wscroll = 0; if (swN && k999) { gotoxy( 77, wherey()); cprintf("%4i", k); } } else if (j25) h = 25 - xx; //re-calc scrn length if (optsw) goto optbrnch; goto getopt; //- - - - - - - - - - - - - - - - - - - - - - - - - //ÄÄÄÄoptn tbleÄÄÄÄ optble: inbox( 6, 18, 70, 6, 7, 1, 1); for (i=1;i<=6;i++) { for (j=0;j<=4;j++) { gotoxy( bxlc[j], i); cprintf("%s", opnms[j][i]); } } gotoxy( bxlc[opbx], op); textattr(113); cprintf("%s", opnms[opbx][op]); mveopt: _setcursortype(0); i = getch(); if (i==0) i = getch() + 100; _setcursortype(2); textattr( 7); gotoxy(bxlc[opbx], op); cprintf("%s", opnms[opbx][op]); switch (i) {case 180 : op = op + 1; if (op>6) op = 1; goto common; case 172 : op = op - 1; if (op<1) op = 6; goto common; case 177 : opbx = opbx + 1; if (opbx>4) opbx = 0; goto common; case 175 : opbx = opbx - 1; if (opbx<0) opbx = 4; common: gotoxy( bxlc[opbx], op); textattr(113); cprintf("%s", opnms[opbx][op]); goto mveopt; case 13 : Oc = opcds[opbx][op];//if (Oc=='f') goto grph; optsw = 1; goto start; }// end swtch loop Oc = i; goto optbrnch; //---------------------------- getopt: textattr(112); _setcursortype(0); i = getch(); if (i==0) i = getch() + 100; rtvdopt: Oc = i; _setcursortype(2); optbrnch: ww = 80; i = Oc; optsw = 0; window( 1, 1, 80, 25); switch (i) {case 175 : Q = Q - h; goto start; case 177 : Q = Q + h; goto start; case 180 : Q = Q - 1; goto start; case 172 : Q = Q + 1; goto start; case 13 : goto optble; }//end 1st swtch branch nad = (char far *) farmalloc(162); if (nad==NULL) Msc = 1; else Msc = 0; farfree(nad); sprintf(ycs,"%c %i->%i", Oc, b, n); d = 0; for (j=b; j<=n; j++) d = d + calcln(ns[j]); //for (k=5;k<=25;k++) gettext( 1, k, 45, k, ssve[k-5]); switch (i) {case 47 : case 'f' : goto grph; case 92 : goto level; case 100 : strcat(ycs, "ÍÍ delete "); prtbx( 20, 9, 32, 5, 116, 116, ycs); goto del; case ')' : strcat(ycs, "ÍÍ right "); prtbx( 20, 10, 25, 4, 120, 112, ycs); goto del; case '(' : strcat(ycs, "ÍÍ left "); prtbx( 20, 10, 25, 4, 120, 112, ycs); goto del; case 48 : strcat(ycs, "ÍÍÍÍÍÍÍ file output "); prtbx( 12, 7, 58, 6, 112, 116, ycs); goto read; case 105 : sprintf(zcs,"%sÍÍÍÍÍÍ file input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ%c", ycs, fsys); prtbx( 12, 7, 58, 6, 112, 112, zcs); goto read; case 'a' : strcat(ycs, " Desegment "); goto lnesegs; case 'A' : strcat(ycs, " Segment "); goto lnesegs; case 109 : strcat(ycs, "ÍÍ move "); prtbx( 16, 9, 23, 4, 120, 112, ycs); goto move; case 'W' : strcat(ycs, "ÍÍ max length move "); prtbx( 16, 9, 35, 5, 120, 112, ycs); goto move; case 'w' : strcat(ycs, "ÍÍ min length move "); prtbx( 16, 9, 35, 5, 120, 112, ycs); goto move; case 'S' : strcat(ycs, "ÍÍ select string move "); prtbx( 12, 9, 55, 5, 120, 112, ycs); goto move; case 'y' : strcat(ycs, "ÍÍ interval merge "); prtbx( 16, 9, 31, 5, 112, 112, ycs); goto mrge; case 'r' : strcat(ycs, "ÍÍÍ search "); prtbx( 3, 14, 73, 12, 113, 112, ycs); goto srch; case 's' : strcat(ycs, "ÍÍÍ swap "); prtbx( 10, 5, 65, 9, 112, 113, ycs); goto swap; case 'v' : goto dir; case '=' : inbox( 5, 4, 70, 1, 23, 0, 0); sad= fnme; x = strlen(fnme); if (x>22) sad= sad- 22 + x; cprintf(" %-22s %6ld %4i->%-4i [%iX%i] r01 " " %-4i %-2i" , sad, d, b, n, ROW, COL, Q, h); //prnt info _setcursortype(0); inbox( 51, 3, 12, 1, 23, 0, 0); fgretme: _dos_gettime(&hrmn); sprintf(tme, "%2i:%2i:%2i", hrmn.hour, hrmn.minute, hrmn.second); if (tme[3] == 32) tme[3] = 48; if (tme[6] == 32) tme[6] = 48; strcpy(bcs, "am"); if (hrmn.hour>11) strcpy(bcs, "pm"); strcat(tme, bcs); gotoxy( 1, 1); cprintf(" %s", tme); if (kbhit()==0) goto fgretme; goto getopt; case 'u' : strcat(ycs, " sort"); prtbx( 20, 11, 26, 6, 23, 112, ycs); intrvl(" interval: "); inbox( 21, 13, 24, 3, 23, 0, 1); for (k=0; k<4; k++) { cprintf("sort fields %i\r\n", k+1); sinf[k][0] = gtc(" sort loc: ", zcs, 0); if (zcs[0]==0) break; if (sinf[k][0] > COL) sinf[k][0] = COL; sinf[k][1] = gtc("\r\nsort str len: ", zcs, 0); clrscr(); }//end k loop gtc("\r\nreverse order?(y)", tme, 0); if (k==0) k = 1; for (z=k-1; z>=0; z--) sort( i, j, sinf[z][0], sinf[z][1]); goto start; case '-' : strcat(ycs, "Ítruncate ending blanks"); prtbx( 12, 11, 45, 4, 113, 112, ycs); goto chopend; case 'R' : strcat(ycs, " reformat text "); prtbx( 15, 8, 37, 5, 48, 48, ycs); goto newrecs; case 't' : prtbx( 21, 6, 29, 5, 7, 7, "ÍÍÍ clipboard portal "); xx = 1; c = 0; cprintf(" portal is open\r\n" " can Paste at line 1\r\n" " press F12 to close portal"); inbox( 1, 11, 80, 6, 7, 0, 35); chrloop: i = getch(); if (i==0) i = getch() + 100; chkchr: if (i==234) { xcs[c] = 0; allc(xx, xcs, 0); goto start; } if (i==13) { xcs[c] = 0; c = 0; cprintf("%s\r\n", xcs); allc(xx, xcs, 0); xx = xx + 1; if (xx>=ROW) xx = ROW; goto chrloop; } xcs[c] = i; c = c + 1; if (c==COL) { xcs[c] = 0; cprintf("%s\r\n", xcs); allc(xx, xcs, 0); c = 0; xx = xx + 1; if (xx>=ROW) xx = ROW; } goto chrloop; case '2' : if (fsys=='w') fsys = 'm'; else fsys = 'w'; goto getopt; case 32 : swN = (!swN && 1); goto start; }//end 2nd swtch branch if (strchr("xlbcpe", i)) prtbx( 19, 10, 21, 3, 23, 23, ycs); switch (i) {case 'x' : cprintf(" exit r01{x}?"); buf = getch(); textattr(112); if (buf=='x') return; else goto start; case 'l' : cprintf("<%i> ", h); x = gtc("scrn len: ", zcs, 0); if (x>0) h = x; goto start; case 98 : b = gtc("1st record: ", zcs, 0); goto start; case 99 : n = gtc("last record: ", zcs, 0); goto start; case 'p' : goto scrn_strt; case 234 : goto entredit; case 'e' : goto edt; }//end 3rd swtch block goto start; //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ // Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä scrn_strt: Q = gtc("line #: ", xcs, 0); if (!xcs[0]) Q = 1; level: Q = (Q/h)*h + 1; goto start; //Äline segmentsÄÄ lnesegs: prtbx( 16, 11, 30, 4, 87, 87, ycs); intrvl("interval: "); s = 1; if (Oc=='A' && xcs[0]==0) goto start; for (k=i;k<=j;k++) { if (ns[k]==NULL) continue; if (Oc=='a') ns[k][-1] = 0; if (Oc=='A') ns[k][-1] = s; s = s + 1; if (s>122) s = 1; } goto start; //ÄÄmerge intrvls of recsÄÄ mrge: intrvl("source intrvl: "); x = 0; t = gtc("start of trgt intrvl: ", xcs, 0); if (!xcs[0]) goto start; y = gtc("\r\nmin left col width: ", xcs, 0); for (k=i;k<=j;k++) { xx = calcln(ns[k]); yy = calcln(ns[t+x]); c = y; if (xx+yy>COL) goto endmrgelp; if (xx+y>COL) c = COL - xx; copyns(zcs, t+x); if (yy25) x = 3; setcolor(dscs[x]); ovlp( 4, 8, crdr); ovlp( 4, 28, fnme); sprintf(xcs, "%ld", d); ovlp( 4, 48, xcs); sprintf(xcs, "%i->%i", b, n); ovlp( 4, 68, xcs); setcolor(8); moveto( 0, 132); linerel( 639, 0); regrph: setviewport( 0, 133, 639, 479, 0); clearviewport(); setcolor(8); t = 640/gw; itoa( gb, xcs, 10); ovlp( 2, 326, xcs); strtfile: moveto( 0, 317); //strt file grph for (x=0;x<=t;x++) { yy = x + gb; if (yy>ROW || ns[yy]==NULL) goto nextrec; z = calcln(ns[yy]); for (y=0;y=640) break; if (yy%100==0 && x>0) { linerel( 0, 10); moverel( 0, -10); } linerel( gw, 0); } // end file graph loop itoa(yy, xcs, 10); ovlp( 600, 326, xcs); if ((bt+gb && n>t+gb)) goto endfilechk; setcolor(15); if (gb<=b && b<=gb+t-1) { moveto( gw*(b-gb), 317); linerel( 0, 5); if (b>=n) { if (gb<=n && n<=gb+t-1) { moveto(gw*(n-gb), 317); linerel( 0, 5); } goto endfilechk; } if ((n-gb)*gw<=639) { linerel( (n-b)*gw, 0); linerel( 0,-5); } else linerel( 639-gw*(b-gb), 0); } //end if else { if (b>=n) { if (gb<=n && n<=gb+t-1) { moveto(gw*(n-gb), 317); linerel( 0, 5); } goto endfilechk; } moveto( 0, 322); if ((n-gb)*gw<=639) { linerel( gw*(n-gb), 0); linerel( 0,-5); } else linerel(639, 0); } //end 1st else endfilechk: i = getch(); if (i==0) i = getch() + 100; if (i==120) i=33; switch (i) {case '.' : gw = gw + 1; goto regrph; case ',' : gw = gw - 1; if (gw<1) { gw = 1; goto endfilechk; } goto regrph; case ' ' : gb = 0; gw = 1; gbt = 0; goto regrph; case 177 : if (gb==0) goto endfilechk; gb = gb - 24; if (gb<0) gb = 0; gbt = 1000 * (gb / 1000); goto regrph; case 175 : gb = gb + 24; gbt = 1000 * (gb / 1000); goto regrph; } //end swtch block if (48COL) y = COL; blks[y] = 0; if (Oc=='d') { cprintf("\r\n Delete?(y)"); x = getch(); if (x!=121) goto start; } for (k=i;k<=j;k++) { r = calcln(ns[k]); if (r==0) continue; Ssc = ns[k][-1]; if (Oc=='d' && r>y) { ns[k][y] = 0; strcpy(bcs, ns[k]); allc(k, bcs, Ssc); } if (Oc==')') { strcpy(ycs, blks); x = y; if (r+y>COL) x = COL - r; if (r==COL) x = 0; ycs[x] = 0; strcpy(zcs, ycs); strcat(zcs, ns[k]); allc(k, zcs, Ssc); } if (Oc=='(') { if (y>=r) { farfree(ns[k]); ns[k] = NULL; continue; } sint = 0; for (yy=y;yy<=r;yy++) { ns[k][sint] = ns[k][yy]; sint = sint + 1; } } }//end del loop blks[y] = 32; goto start; //ÄMove file recsÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ move: intrvl("intrvl: "); t = gtc(" trgt: ", xcs, 0); if (!xcs[0] || (i<=t && t<=j)) goto start; if (Oc=='W') jh = gtc("\r\nmax line length: ", xcs, 0); if (Oc=='w') jh = gtc("\r\nmin line length: ", xcs, 0); if (Oc=='S') gtc("\r\nstring:", xcs, 1); //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ mventr: //³ x = -1; //³ 79 x=-1 if (jjh) ih = 1; //³ if (Oc=='w' && //³ calcln(ns[k])COL ) //³ goto endswap; //³ fad = strstr(sad, xcs); //³ if (fad==NULL) goto endswap; //³ t = int(fad - sad); //³ y = 0; //³ for (x=z;x", xcs, 48); if (xcs[0]==0) { cprintf("\rsegment search?(y):"); buf = getch(); cprintf("\r"); clreol(); if (buf!=121) cprintf("non-empty: "); else cprintf("segments: "); for (i=0;i<=ROW;i++) { if (ns[i]==NULL) continue; if (buf!=121) if (ns[i][0]) cprintf("%i ", i); else; else if (ns[i][-1]) cprintf("%i ", i); }//end i loop goto endsrch; }// end if block cprintf("\r<%s>: ", xcs); clreol(); for (i=0;i 13,10 lskp = 0; cskp = 0; lmsd = 0; cmsd = 0; sint = n; newrec: buf = fgetc(fle); z = 0; c = 0; bcs[0] = 0; bcs[160] = 0; chkbuf: if (feof(fle)) goto endr; if (buf==13 && fsys=='m') { bcs[c] = 0; goto fillrec; } if (buf==13 && !swB) { buf = fgetc(fle); goto chkbuf; } if (buf==0 || buf==8 || buf==7) { buf = trns[buf]; swB = 1; } c = c + 1; if (buf==10) { buf = 32; if (!swB) { bcs[c-1] = 0; goto fillrec; } if (z) { if (c<2) c = 2; bcs[c-2] = 0; goto fillrec; } } if (c>COL) { bcs[COL] = 0; recx(s); c = 1; bcs[0] = 0; s = s + 1; if (s>122) s = 1; bcs[160] = s; } z = 0; if (buf==13) { buf = 32; z = 1; } bcs[c-1] = buf; buf = fgetc(fle); goto chkbuf; fillrec: recx(bcs[160]); s = 1; goto newrec; endr: bcs[c] = 0; if (c) recx(bcs[160]); closer: fclose(fle); d = 0; for (j=b; j<=n; j++) d = d + calcln(ns[j]); if (swB) { prtbx(29, 1, 52, 5, 103, 103, "ÍÍ***Caution - Binary File - Do Not Update***"); cprintf(" %i->%-i %ld\r\n %s", b, n, d, fnme); if (!lskp && !lmsd) goto getopt; } m = 0; for (j=sint+1; j<=n; j++) m = m + calcln(ns[j]); if (lskp || lmsd) { prtbx(10, 15, 47, 7, 113, 112, "ÍÍ***Caution - some file data was lost***"); cprintf(" Lines read: %i, Characters read: %6ld\r\n", n-sint, m); cprintf("Data lost:\r\n"); cprintf("---------- file lines characters\r\n"); cprintf("start of file %6ld %6ld\r\n", lskp, cskp); cprintf(" end of file %6ld %6ld", lmsd, cmsd); goto getopt; } Oc = '='; optsw = 1; goto start; ortn: _setcursortype(0); cprintf("\r..writing file..."); clreol(); if ((fle=fopen(fnme, "w"))==NULL) goto err; for (i=b;i<=n;i++) { if (ns[i] == NULL) goto endloop; for (k=0;k=0) { cprintf("%s", ns[i]); clreol(); calcln(ns[i]); if (Len<=80) xx = xx + 1; else xx = xx + 2; fh = xx; if (Len!=80) cprintf("\r\n"); }//prt prev recs yy = wherey(); prtrec: cprintf("%s", bcs); clreol(); //prt curr rec cprintf("\r\n"); Len = c; if (Len<=80) xx = xx + 2; else xx = xx + 3; for (i=et+1;i20) break; if (Len!=80) cprintf("\r\n"); cprintf("%s", ns[i]); clreol(); mh = i; calcln(ns[i]); if (Len<=80) xx = xx + 1; else xx = xx + 2; }//end 2nd prt loop for (i=xx+1;i<=24;i++) { gotoxy( 1, i); clreol(); } gotoxy( 1, yy); if (c<=80) { cprintf("\n"); if (o==80) cprintf("\n"); goto endprtsgs; } //prt shorter recs prtsecd: if (o==80) { gotoxy( 1, yy); cprintf("%s", bcs); clreol(); gotoxy( 1, yy+2); goto endprtsgs; } gotoxy( 1, yy+1); cprintf("%s", bcs); clreol(); gotoxy( 1, yy+1); endprtsgs: cprintf("\r"); clreol(); gotoxy(w1+1, wherey()); strte: x = bcs[w1+o]; if (x<0) x = 256 + x; xp = wherex(); yp = wherey(); gotoxy(39, 1); cprintf("pos %-3i cde %-3i", w1+o+1, x); clreol(); if (bcs[160]) cprintf(" seg %2i", bcs[160]); gotoxy(xp, yp); textattr(113); _setcursortype(0); cprintf("%c\b", 223); if (w1==79) gotoxy(80, wherey()-1); textattr(112); i = getch(); Ec = i; if (i==0) i = getch() + 100; _setcursortype(2); if (Ec>31) goto gdchr; switch (i) {case 175: w1 = w1 - 1; if (w1<0) { if (o==0) { w1 = 0; goto strte; } //| else { w1 = 79; o = 0; //| cprintf(" "); gotoxy(wherex(), -1+wherey()); //| if (c==80) goto endprtsgs; //| goto prtsecd; } } //| if (w1==78) { cprintf(" "); gotoxy(79, -1+wherey()); } else cprintf(" \b\b"); goto strte; //end left movemnt case 177: if (w1+o>=c) goto strte; w1 = w1 + 1; cprintf(" "); if (w1>79) goto secseg; goto strte; //end right mvement case 180: if (c>80 && o==0) { o = 80; goto prtsecd; } if (et>=ROW) goto strte; if (calcln(ns[et])>80 && calcln(ns[et-Lb])<=80 && fh>19 && xx>21) Lb = Lb - 1; if (et0) Lb = Lb - 1; if (calcln(ns[et])>80) o = 80; goto redit; //end up mvmnt case 173: allc(et, bcs, bcs[160]); o = 0; if (Lb>7) { et = et - (Lb-7); Lb = 7; goto redit; } et = et - 2; if (et<0) et = 0; goto redit; //end 2x up mvmnt case 181: allc(et, bcs, bcs[160]); o = 0; if (Lb<7) { et = et + (7-Lb); Lb = 7; goto redit; } if (Lb>7) Lb = 7; et = et + 2; if (et>ROW) et = ROW; goto redit; //end 2x dwn mvmnt case 13 : goto eopt; case 171: { w1 = 0; cprintf("\r"); clreol(); if (o==0) goto strte; gotoxy(wherex(), wherey()-1); o = 0; if (c==80) goto strte; goto prtsecd; }// end go to strt of rec case 179: { if (c<=80) { if (o==80) { cprintf(" "); gotoxy(wherex(), wherey()-1); o = 0; w1 = 79; } else if (c) w1 = c - 1; else { w1 = 0; cprintf(" \r"); } goto endprtsgs; } if (c>80) w1 = c - 81; if (o==0) { o = 80; cprintf("\r"); goto prtsecd; } else goto endprtsgs; }//end end of rec pos blck case 182 : case 183 : cprintf("%c\b", (182-i)*5 + 73 ); if (w1==79) gotoxy( 80, wherey()-1); insdel: z = gtc( "", zcs, 232); if (i==183 || Ec==107) { if (z+w1+o>c) z=c-w1-o; for (i=0;iCOL) { z = COL - c; zcs[z] = 0; } strcpy(xcs, bcs); xcs[w1+o] = 0; strcat(xcs, zcs); for (i=w1+o;i<=c;i++) xcs[i+z] = bcs[i]; strcpy(bcs, xcs); }//end insert block goto prntedit; //end insert/delete blck case 27: case 234: allc(et, bcs, bcs[160]); goto start; }//end sw blk goto strte; gdchr: if (w1+o>=c) goto addch; bcs[w1+o] = Ec; w1 = w1 + 1; gotoxy(wherex(), wherey()-1); cprintf("%c", Ec); gotoxy(wherex(), wherey()+1); cprintf("\b "); if (w1>79) goto secseg; goto strte; //---------------------------------- addch: if (w1+o+1>COL) goto strte; bcs[w1+o] = Ec; w1 = w1 + 1; bcs[w1+o] = 0; c = c + 1; gotoxy(wherex(), wherey()-1); cprintf("%c", Ec); gotoxy(wherex(), wherey()+1); cprintf("\b "); if (w1>79) secseg: { w1 = 0; o =80; gotoxy( 1, yy); if (c==80) goto prtrec; else goto prtsecd; } goto strte; //--------------------------------------- eopt: cprintf("O\b"); Ec = getch(); cprintf("%c ", Ec); switch (Ec) {case 0 : goto eopt; case 'x': numseg(); goto start; case 13: allc(et, bcs, bcs[160]); goto entredit; case 'c': case 'y': if (Ec=='y') { copyns(xcs, et+1); Ssc = xcs[160]; for (i=0;i=COL) goto start; zcs[0] = 0; for (k=i;k<=j;k++) { sad = ns[k]; if (sad==NULL) { allc(t, zcs, 0); zcs[0] = 0; t = t + 1; continue; } s = strlen(sad); for (r=0;r=(xx+jh)) strcat(zcs, xcs); else { zcs[xx-1] = 0; allc(t, zcs, 0); zcs[0] = 0; t = t + 1; strcpy(zcs, xcs); } r = c; }//end r loop }//end k loop if (zcs[0]!=0) allc(t, zcs, 0); goto start; //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ chopend: intrvl("intrvl: "); for (k=i;k<=j;k++) { if (ns[k]==NULL) continue; for (x=calcln(ns[k])-1;x>=0;x--) { if (ns[k][x]!=32) { ns[k][x+1] = 0; break; } }//end x loop if (x<0) { farfree(ns[k]-1); ns[k] = NULL; } }//end k loop goto start; //ÄÄÄdir rtnÄÄÄÄÄÄÄÄÄÄ dir: Lst = 0; getdir(0); strtdir: strcpy(xcs, crdr); entrdir: _setcursortype(0); if (crdr[0]!=dsc) { dsc = crdr[0]; sprintf(dcs, "%c:", dsc); } if (strlen(xcs)==3) xcs[2] = 0; if (strchr(xcs, '*')==NULL) strcat(xcs, "\\*.*"); if (Lst<2) fill(dot1, 801); else strcpy(dx[801], dx[N+2]); den = 0; kd = 0; kx = 0; N = 801; d = _dos_findfirst(xcs, 63, &ffblk); while (!d) { x = ffblk.attrib; ycs[0] = 0; buf = 0; sprintf(ccs, " %ld", ffblk.size); cnm = ffblk.wr_time / 2048; y = ffblk.wr_time - (cnm * 2048); y = y / 32; lead0(tcs); z = ffblk.wr_date / 512; y = ffblk.wr_date - (z * 512); y = y / 32; lead0(mn); if (mn[0]==48) mn[0] = 32; y = ffblk.wr_date % 32; lead0(dy); y = z + 80; if (y>=100) y = y - 100; lead0(yr); if (x>=32) { strcat(ycs, "a"); x = x - 32; } if (x>=16) { if (strcmpi(ffblk.name, ".")==0) goto endd1lp; buf = 1; strcpy(ccs, "Dir"); x = x - 16; kd = kd + 1; } if (x>= 8) { strcpy(ccs, "Label"); buf = 1; x = x - 8; strcpy(dcs, ffblk.name); kx = 1; } if (x>= 4) { strcat(ycs, "s"); x = x - 4; } if (x>= 2) { strcat(ycs, "h"); x = x - 2; } if (x>= 1) strcat(ycs, "r"); if (buf==0 && rptsw==1) goto endd1lp; sprintf(dcm, "%-12s %-4s%-9s %s-%s-%s %2ld:%sa", ffblk.name, ycs, ccs, mn, dy, yr, cnm, tcs); numfrmt(); if (cnm>=12) dcm[42] = 'p'; if (z>=20) dcm[33] = '/'; rsort(); den = den + 1; endd1lp: d = _dos_findnext(&ffblk); }//end while block N = N - 1; if (den>800 && Lst==0) Lst = 1; fill(xcs, N); kf = den - kx - kd; fill(vdisks, 801); rptln = 23; if ((802-N)<23) rptln = 802 - N; if (enm==-1) { enm = 1; rptst = 0; } else if (enm==-2) { enm = 800; rptst = 802 - rptln; } else { enm = 803 - rptln; rptst = enm - 1; } if (enm==801) enm = 800; inbox(46, 1, 35, 5, 112, 2, 1); cprintf(" %s %i files, %i dirs\r\n ", dcs, kf, kd); getdir(2); cprintf("\r\nÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); if (rptln<23) inbox( 1, rptln+3, 45, 23-rptln, 112, 0, 1); // for (vr=(rptln+3);vr<=25;vr++) // puttext( 1, vr, 45, vr, ssve[vr-5]); } prtbx( 1, 1, 45, rptln+2, 112, 112, "name attribute size updatedÍÍÍ"); pdir(); dsrch: i = getch(); if (i==0) i = getch() + 100; switch (i) { case 180 : dwnkey: if (rptst>=801) goto dsrch; if (enm>=801) { rptst = rptst + 1; enm = 801; } enm = enm + 1; if (enm>(rptst+rptln-1)) rptst = rptst + 1; goto endmove; //move enm rec down case 172 : if (enm==N && Lst==1) { enm = - 2; Lst = 2; goto strtdir; } upkey: if (N==(rptst+rptln-1)) goto dsrch; if (enm<=N) { rptst = rptst - 1; enm = N; } enm = enm - 1; if (enm801) enm = 801; if (enm>(rptst+rptln-1)) if (enm==801) rptst = enm - rptln + 1; else rptst = rptst + rptln; endmove: pdir(); if (enm==801) goto seldsk; goto dsrch; // page down case 232 : enm = N; rptst = N; pdir(); goto dsrch; // mve to top rec case 218 : enm = 801; rptst = 802 - rptln; pdir(); goto seldsk; // mve to end rec case 'p': _setcursortype(2); altrdir: prtbx( 1, 3, 45, 5, 23, 23, "ÍÍChange Directory"); gtc("new dir: ", xcs, 15); fwrd(xcs); strcpy(xcs, zcs); goto diffdir; case 'x' : goto start; case 159 : case 13 : sad = dx[enm]; if (N<=enm && enm<801) fwrd(sad); else goto upkey; if (orec[1]==':' || orec[0]=='.' || strstr(sad+12, "Dir") != NULL) { strcpy(xcs, orec); diffdir: chgdir(xcs, 0); Lst = 0; if (strchr(xcs, '*')!=NULL) goto entrdir; goto dir; } strcpy(ycs, crdr); if (ycs[strlen(ycs) - 1] != '\\') strcat(ycs, "\\"); strcat(ycs, zcs); strcpy(fnme, ycs); if(fc<17) { fc = fc + 1; strcpy(kmem[fc], fnme); } inbox( 1, 12, 45, 3, 103, 0, 1); _setcursortype(2); cprintf(" last rec: %i ", n); x = gtc("\r\n last rec chg: ", zcs, 0); if (zcs[0]!=0) n = x; goto inptstrt; }// end swtch loop goto rtvdopt; //Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä seldsk: fad = dx[enm]; fad = fad + 8; gotoxy(1, yds); textattr(112); cprintf(" disks: %s", fad); prtdsk: gotoxy(w+9, yds); textattr(127); cprintf("%c", fad[w]); seloop: textattr(112); i = getch(); if (i==0) i = getch() + 100; switch (i) { case 175 : case 177 : gotoxy(w+9, yds); cprintf("%c", fad[w]); if (i==177) if (fad[w+2]!=32) w = w + 2; else; else if (w>2) w = w - 2; goto prtdsk; case 'x' : case 27 : case 172 : exitse: getdir(0); goto upkey; case 180 : getdir(0); if (Lst==2) { enm = -1; Lst = 1; goto strtdir; } goto dwnkey; //dwn key optn case 13 : xcs[0] = fad[w]; xcs[1] = ':'; xcs[2] = 0; chgdir(xcs, 0); goto dir; case 181 : rptst = 802 - rptln; pdir(); goto seldsk; case 173 : goto pgeup; }//up key optn end swtch block goto seloop; //Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä Ä //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ } //end Main //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //get intrvl bnds// void intrvl(char *msg) {i = gtc(msg, xcs, 0); j = gtc("->", xcs, 0); if (i>j) j = i; cprintf("\r%s %i->%i \r\n", msg, i, j); return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void chgdir(char *dir, char cpf) { if (dir[1] != ':') { strcpy(tcs, crdr); if (strlen(tcs) > 3) strcat(tcs, "\\"); strcat(tcs, dir); strcpy(dir, tcs); } if (dir[0]>90) setdisk(dir[0] - 97); else setdisk(dir[0] - 65); fad = strstr(dir, "\\."); if (fad!=NULL) { for (x=fad-dir-1;x>=3;x--) { if (dir[x]=='\\') { dir[x] = 0; break; } } } if (chdir(dir)==0 || strlen(dir)<60) { strcpy(crdr, dir); getdir(cpf); } return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void getdir(char cpf) { rtdr[0] = 'a' + getdisk(); if (strlen(crdr)==2) strcpy(crdr, rtdr); if (getcurdir(0, tcs)==0) { strcpy(crdr, rtdr); strcat(crdr, tcs); } if (cpf) { if (cpf==1) cprintf("curr dir: %s \r\n", crdr); else cprintf("%s", crdr); } nad = vdisks; nad = nad + 8; w = strchr(nad, crdr[0]) - nad; return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void numseg(void) { s = 1; for (i=1;i=ROW) break; } }//end k loop //end i loop return; } //ÄÄÄget strs for rtnsÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ long int gtc(char *msg, char *bs, int ff) { int w=0, c=0, i, mx, my, f=0, tc, bnd=159, sg; bs[0] = 0; gettextinfo(&tscrn); tc = tscrn.attribute; if (ff>199) { tc = ff - 200; ff = 2; } // for insrt/del fnctns if (ff>2) { tc = ff; ff = 1; } // for diffng colors frm scrn ones cprintf("%s", msg); mx = wherex(); my = wherey(); if (ff>2) clreol(); if (ff==0) bnd = 4; prntedit: gotoxy( mx, my); i = c - strlen(bs); if (i<0) i = 0; blks[i] = 0; textattr( tc); cprintf("%s", bs); textattr(tscrn.attribute); cprintf("%s", blks); blks[i] = 32; postn: if ( mx+w<=ww) gotoxy( mx+w, my); else { sg = (mx+w) / ww; gotoxy( mx+w-(ww*sg), my+sg); } strte: c = strlen(bs); textattr(tc); i = getch(); if (i==0) i = getch() + 100; switch (i) { case 160 : case 175: w = w - 1; if (w<0) { w = 0; goto strte; } if ((mx+w)==ww*((mx+w)/ww)) gotoxy( ww, wherey()-1); else gotoxy(wherex()-1, wherey() ); goto strte; //end left movemnt case 161 : case 177: if (w+1>=bnd || w>=c) { goto strte; } w = w + 1; cprintf("%c", bs[w-1]); goto strte; //end right mvement case 162: w = 0; f = 0; bs[0] = 0; goto prntedit; case 159: case 13 : if ( (ff==1 && fc<16 && bs[0]!=0) && (f==0 || strcmp(bs, kmem[f])!=0) ) { fc = fc + 1; strcpy(kmem[fc], bs); } m = atol(bs); if (ff>0) m = c; textattr(tscrn.attribute); gotoxy( mx, my); cprintf("%s", bs); if (m>ROW) return(ROW); return(m); case 171: w = 0; goto postn; //end start of rec rtn case 179: if (c) w = c - 1; else w = 0; goto postn; //end end of rec pos case 163: if (!ff || !f) goto prntedit; if (f=bnd) goto strte; for (i=c;i>=w;i--) bs[i+1] = bs[i]; bs[w] = 32; c = c + 1; goto prntedit; case 9 : case 180: if (!ff) goto prntedit; f = f + 1; if (f>fc) f = 0; strcpy(bs, kmem[f]); w = 0; goto prntedit; case 27 : case 172: if (!ff) goto prntedit; f = f - 1; if (f<0) f = fc; strcpy(bs, kmem[f]); w = 0; goto prntedit; }//end sw block if (i<32 || 128=c) goto addch; bs[w] = i; if (w+1>=bnd) { cprintf("%c\b", i); goto strte; } w = w + 1; cprintf("%c", i); goto strte; addch: if (w>=bnd) goto strte; bs[w] = i; bs[w+1] = 0; if (w+1>=bnd) { cprintf("%c\b", i); goto strte; } w = w + 1; cprintf("%c", i); goto strte; } //end gtc() rtn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void prtbx(int x,int y,int wd,int ht, int clr, int clr2, char *ms) { char ps[99]; if (clr==clr2) inbox(x, y, wd, ht, clr2, 0, 1); else inbox(x+1, y+1, wd-2, ht-2, clr2, 0, 1); window(x, y, x+wd-1, y+ht-1); strcpy(ps, ms); ps[wd-4] = 0; textattr(clr); if (strchr("xlbcpeu", Oc)) bordr(wd, ht, ' ',' ',' ',' ',' ',' '); else bordr(wd, ht, 'É','»','¼','È','Í','º'); gotoxy( 3, 1); cprintf("%s", ps); gotoxy( 3, ht); cprintf("%s", msgm[Msc]); inbox(x+1, y+1, wd-2, ht-2, clr2, 0, 0); return; }//end prtbox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void inbox(int x,int y,int wd,int ht,int clr,char wc,int cls) { window(x, y, x+wd-1, y+ht-1); textattr(clr); if (cls) clrscr(); if (wc) window(x, y, x+wd-1, y+ht+wc-1); ww = wd; return; }//end inbox //ÄÄÄÄbordr rtnÄÄÄÄÄÄÄÄÄ void bordr(int wd,int ht,char ul,char ur,char lr,char ll,char hz,char vt) { int vry; cprintf("%c", ul); for (vry=1;vry<=wd-2;vry++) cprintf("%c", hz); cprintf("%c", ur); for (vry=2;vry<=ht-1;vry++) { cprintf("%c", vt); gotoxy(wd, vry); cprintf("%c", vt); } cprintf("%c", ll); for (vry=1;vry<=wd-2;vry++) cprintf("%c", hz); _wscroll = 0; cprintf("%c", lr); _wscroll = 1; return; }//end bordr rtn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ int ansichk(char *msg, char *ch, int f1) {gtc(msg, ch, f1); if (ch[0]==0) { cprintf("\rcode> "); clreol(); ch[0] = gtc("", ch, 0); ch[1] = 0; } return(strlen(ch)); } //Äsort rtnÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void sort(int i, int j, int t, int s) { int si, k, sk, c; if (j==0 || t==0 || s==0) goto rvrse; for (k=i;k<=j;k++) { sk = k; if (ns[k]==NULL) continue; for (c=k+1;c<=j;c++) { sad = ns[sk]; sad = sad + t - 1; strcpy(ycs, sad); if (sk) mrec: { nad = ns[sk]; for (si=sk;si>k;si--) { ns[si] = ns[si-1]; ns[si][-1] = 0; } ns[k] = nad; ns[k][-1] = 0; } }//end if, end k for loop rvrse: if (tme[0]=='y') { c = j; for (k=i;k<=(j-i+1)/2;k++) { nad = ns[k]; ns[k] = ns[c]; ns[c] = nad; ns[k][-1] = 0; ns[c][-1] = 0; c = c - 1; } }//end if, k loop return; }//end sort rtn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void ovlp(int xg, int yg, char *scs) { outtextxy( xg, yg, scs); outtextxy(1+xg, yg, scs); return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ char allc(int sub, char *rec, char seg) { int Ln; Ln = calcln(rec); if (Ln==0) { if (ns[sub] != NULL) farfree(-1+ns[sub]); ns[sub] = NULL; return(0); } if (Ln>calcln(ns[sub]) || ns[sub]==NULL) { nad = (char far *) farmalloc(2+Ln); if (nad==NULL) { ns[sub] = NULL; return(1); } farfree(ns[sub]-1); ns[sub] = 1 + nad; } strcpy(ns[sub], rec); ns[sub][-1] = seg; return(0); } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void recx(char snmbr) { sl = sl - 1; if (sl<0) { if (n<9799) { if (Msc) goto missrec; n = n + 1; Msc = allc(n, bcs, snmbr); if (Msc) { n = n - 1; goto missrec; } else; } else { missrec: lmsd = lmsd + 1; cmsd = cmsd + strlen(bcs); } } else { lskp = lskp + 1; cskp = cskp + strlen(bcs); } return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ int calcln(char *rgn) { Len = 0; if (rgn!=NULL) Len = strlen(rgn); return(Len); }//end calcln rtn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ void copyns(char *tgt, int ndx) { if (ns[ndx]!=NULL) { strcpy(tgt, ns[ndx]); tgt[160] = ns[ndx][-1]; } else { tgt[0] = 0; tgt[160] = 0; } return; }//end copyns rtn //ÄÄrsort rtnÄÄÄÄÄ void rsort() { strcpy(ccs, dcm); for (k=801;k>=N;k--) { pad[0] = pad[ 8]; pad[1] = pad[ 9]; pad[2] = pad[10]; sad = dx[k]; sad = sad + 25; strcpy(ycs, sad); ycs[0] = ycs[ 8]; ycs[1] = ycs[ 9]; ycs[2] = ycs[10]; for (vr=0;vr<11;vr++) { pad[vr+18] = dcm[vr]; ycs[vr+18] = dx[k][vr]; } pad[30] = 0; ycs[30] = 0; if (strcmpi(pad, ycs)>=0) { y = k; break; } }//end if, end k for loop if (11) N = N - 1; fad = dx[N]; dx[N] = dx[k]; for (vr=N;vr 57) return; strcpy(ycs, fad); fwrd(ycs); i = strlen(zcs); x = i - 1; for (k=25;k>=16;k--) { if (x < 0) { dcm[k] = ' '; continue; } dcm[k] = zcs[x]; x = x - 1; if (((i-x-1) % 3)==0 && x>=0) { k = k - 1; dcm[k] = ','; } } //end k loop, `if' block return; }//end numfrmt rtn //------------------// void lead0(char *rs) { sprintf(rs, "%2i", y); if (y<10) rs[0] = 48; return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ// void fwrd(char *chkcs) { fad = NULL; strcpy(orec, chkcs); nad = orec; for (j=0;j=strlen(cst)) fad[k] = 32; } fad[43] = 0; return; } //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÕÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» //³ ==========end of r01 program=========== º //ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ