Echo Reader !

ZXNet echo conference «code.zx»

From Michael Kondratyev To Igor Gruzdev 24 September 1997

Hello Igor! Wed Sep 24 1997, Igor Gruzdev concocted a letter to Vladimir Larkov: IG> Usually yes, but here I am a little guilty. I have a long line trimmer IG> (by request) looks for the first space after the 76th character in the line and inserts it there IG> 0Dh. That's why lines with 86 characters can appear... =========== Cut and save =========== int AreaPuts(int ano, char *line) { static char lw_buf[256]; static int lw_idx=0, lw_dem=0; int i; char c, *pline; if(!OutBundleWrap) return fwrite(line, strlen(line), 1, AREA[ano].fp); for(pline=line; c=*pline; pline++) { lw_buf[lw_idx++]=c; switch(c) { case 13: i=fwrite(lw_buf, lw_idx, 1, AREA[ano].fp); lw_idx=0; lw_dem=0; if(!i) return 0; break; case 32: lw_dem=lw_idx; default: if(lw_idx>OutBundleWrap) { if(!lw_dem) { i=fwrite(lw_buf, lw_idx-1, 1, AREA[ano].fp); lw_buf[0]=lw_buf[lw_idx-1]; lw_idx=1; lw_dem=0; if(!i) return 0; lw_buf[1]=13; if(!fwrite(lw_buf+1, 1, 1, AREA[ano].fp)) return 0; } else {for(i=lw_dem-1; lw_buf[i-1]==32;) i--; lw_buf[i]=13; i=fwrite(lw_buf, i+1, 1, AREA[ano].fp); lw_idx-=lw_dem; if(lw_idx) memcpy(lw_buf, lw_buf+lw_dem, lw_idx); lw_dem=0; if(!i) return 0; } } break; } } return 1; } =========== Вырежь и сохрани =========== With best wishes, Michael.

From Igor Gruzdev To Michael Kondratyev 24 September 1997

Hello Michael! It’s quiet outside the window, and I’m sitting and writing a response to a letter written from Michael Kondratyev to Igor Gruzdev Wed Sep 24 1997 at 04:15... IG>> Usually yes, but here I’m still a little to blame. I have a long line trimmer IG>> (by request) looks for the first space after the 76th character in the line and inserts it there IG>> 0Dh. That's why lines with 86 characters can appear... MK> =========== Cut and save =========== [blurred by rain] MK> =========== Cut and save =========== Total about 60 lines. I have this: (file: pkt2file.pas)───────────── txtbuf:=concat(txtbuf,buf); if a>79 then begin za:=length(txtbuf); repeat dec(za) until txtbuf[za]=' '; zapath:=copy(txtbuf,0,za); txtbuf:=copy(txtbuf,za+1,length(txtbuf)-za); write(out,zapath+chr(13)); a:=length(txtbuf); end; (file: pkt2file.pas)───────────── They also say that Pascal is a sax. :) With all kinds of regards and wishes. Igor.