Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!kitty!larry From: larry@kitty.UUCP (Larry Lippman) Newsgroups: comp.lang.c,comp.sys.ibm.pc Subject: Re: Unbuffered I/O using MicroSoft C 3.0 Message-ID: <1527@kitty.UUCP> Date: Fri, 9-Jan-87 11:40:49 EST Article-I.D.: kitty.1527 Posted: Fri Jan 9 11:40:49 1987 Date-Received: Sat, 10-Jan-87 03:39:13 EST References: <1867@sunybcs.UUCP> Organization: Recognition Research Corp., Clarence, NY Lines: 61 Summary: This is a _printer_ problem, not a C or OS problem Xref: mnetor comp.lang.c:645 comp.sys.ibm.pc:888 In article <1867@sunybcs.UUCP>, ugwayne@sunybcs (Wayne Nelligan) writes: > A friend of mine recently asked me "If I knew of a program that would let > your printer act like a typewriter?". Since a program of this sort seemed > really easy to write (just get characters and send them to the printer), I > decided I would just write one myself. Well, I am sorry to say, things have > not been as easy as I thought they would be. The problem is that I can't get > the printer to just print one character at a time. It only prints out a line > at a time. > I am using MicroSoft C 3.0 and I have tried various methods but each time > the printer only prints out when I enter a Carriage Return. > [further discussion of C I/O functions] The problem you relate has nothing to do with C programming or the nature of your operating system - it strictly pertains to the functional characteristics of your printer. Many electromechanical printers using wire-matrices, bands, chains printwheels, etc. can only print the line buffer all at once (this is an inherent printer design characteristic). Most "better-quality" printers of the above genre will permit "overprinting" of a line; i.e., printing a line buffer without advancing the paper. Comparatively few printers (that are also NOT KSR terminals) will truly print one character at a time. To cite a few examples from looking around my lab: 1. AT&T/Teletype 40P202 (132 col 300 lpm chain printer): prints the line buffer without advancing the paper prints the line buffer with advancing the paper NO single-character printing 2. Okidata Microline 82A (120 cps wire-matrix printer): prints the line buffer with advancing the paper advances the paper one line but prints nothing NO single-character printing 3. Centronics Horizon H136A (120 cps wire-matrix printer): prints the line buffer without advancing the paper, provided that an option switch is set to disable paper advance on prints the line buffer with advancing the paper NO single-character printing 3. Centronics 703 (120 cps wire-matrix printer): prints the line buffer without advancing the paper advances the paper one line but prints nothing NO single-character printing Note the different characteristics of the above printers. By far, the Okidata is the "cheapest" of the above printers, and there just ain't no way to get it to print other than a whole line along with advancing the paper. Now you should see where your problem lies. There may be a way around the problem under some circumstances - keep overprinting, with each successive overprint using space characters to force the desired character into proper position. However, this does seem to be rather extreme. There is an important moral to what may seem like a trivial discussion: Depending upon your printer and its configuration, simple C statements directing output to a printer (i.e., though a stream defined as a printer using fputc, fputs, fprintf, etc.) may NOT do what you think they should! <> Larry Lippman @ Recognition Research Corp., Clarence, New York <> UUCP: {allegra|bbncca|decvax|nike|rocksanne|watmath}!sunybcs!kitty!larry <> VOICE: 716/688-1231 {hplabs|ihnp4|mtune|seismo|utzoo}!/ <> FAX: 716/741-9635 {G1,G2,G3 modes} "Have you hugged your cat today?"