jay@garfield.UUCP (06/19/86)
Does anybody know how to send output to the printer from programs
compiled using C-POWER? I have not been having much luck with it.
This program:
#include <stdio.h>
main()
{
open(4,4,0);
fprintf(4,"hello world\n);
close(4);
}
gave me as output:
one line of graphic characters
then a formfeed
then some more graphic characters and HELLO WORLD at the end.
Any ideas.
dwl10@amdahl.UUCP (06/23/86)
In article <1304@garfield.UUCP>, jay@garfield.UUCP writes: > This program: > #include <stdio.h> > main() > { > open(4,4,0); > fprintf(4,"hello world\n); > close(4); > } > > gave me as output: > one line of graphic characters > then a formfeed > then some more graphic characters and HELLO WORLD at the end. > > Any ideas. I don't know if it makes any difference, but when I do the open to my printer, I use: open(4,4,""); The open routine expects to find a pointer to a filename as the third parameter . Perhaps it's taking whatever location zero is pointing to, and sending it to the serial bus as a filename. Since the printer doesn't know what a file name is, it just prints it. Also, what kind of printer interface are you using, or is it a CBM printer? Perhaps secondary chan 4 isn't the correct one to use. -- ------------------------------------------------------------------- Dave Lowrey "So it goes, so it goes, so it goes, so it goes. But where it's going, nobody knows" [Nick Lowe] ...!{ihnp4,cbosgd,hplabs}!amdahl!dwl10 [ The opinions expressed <may> be those of the author and not necessarily those of his most eminent employer. ]