[net.micro.atari] Question about C for the ST

pwp@iuvax.UUCP (02/12/86)

Does anyone know how to redirect standard output to the printer in
the Digital Research C compiler? The manual included with the ST developer
kit suggests that directing output to /dev/lp or to LST should work,
but in each case these produce a file of the same name.

Does anyone know how to redirect standard output to the printer from
within a C program?

The getchar routine (also gets) do not respond to the RETURN key, they just
wait for you to type another key (They treat CONTROL-RETURN as a return).
Does anyone know of a clean fix for this problem? At present I am using
Cconin and anding the result with 0X7F, but it takes a good bit of
reprogramming to get the effect of gets including the correct action on
CONTROL-h, etc.

ericr@hpvclc.UUCP (ericr) (02/20/86)

To redirect to the printer:

	batch c prog >PRN:

		     ^
		     Note that there is no space.


The stdio routine gets(and therefore scanf) requires a CTL-J to terminate
the line.  This is an acknowledged bug and is supposed to be fixed in the
next software release.  You can use the BDOS read string command to come
close to a gets.  The documentation is in error in that the returned 
string is NOT null terminated.  If you are interested, I can send you
a short routine which emulates gets quite effectively.

Eric Ross
ihnp4!hpfcla!hpvcla!ericr
Vancouver, WA.