On Thu, 3 Jul 2003 12:44:29 UTC, Chun-Chieh Wang
<sh***@es01.adm.nctu.edu.tw> wrote:
how does the '\f' affect output?
in what situation will I use '\f' ?
Every time you knows that you doesn't print to a real endless stream
of bytes, but to a (series) of forms. '\f' tells the driver that the
current form is finished and that another should be made ready. If you
prints to a screen, the scrren gets cleard, if you prints to a card
puncher the current card gets released and the next one positioned so
that the next print will start at column one, if you prints to a
printer the current page gets removed from the printer and the next
one gets inserted so that the first logical printable line gets
presented, if you prints to a file that is formed as something a
printer driver (e.g. postcript or hpgl or something else) will know
what it has to do when it gets the page presented to put it out to its
device.
To make it short, on text streams (binary streams will always ignore
any special meaning):
- '\n' closes a line
- '\f' closes a page
- '\t' prints a tab wide spaces (whereas the definition of the tab
depends on the driver attached to the stream.)
- '\b' lets the logical cursor go a char backwards
whereas this cursor may be a the cursor on screen, the printhead,
a pinter inside the print buffer on the device or the driver....
- '\a' may ring a bell, a siren, or another device that
does require the attention of the operator or even does nothing when
no device that can be activated on that signal gets activated.
On a PC it will give traditionally a signal to the speaker or
play a wave file through the soudcard - or even do nothing or
something else.
This depends completely on the driver that receives the stream.
There are more special defined charachters to modify the stream in
shorthand or with special meaning.
So a C programm has many possibilities to modify the visible result
often without knowing which device is attached to it.
--
Tschau/Bye
Herbert Rosenau
http://www.pc-rosenau.de eComStation Reseller in Germany
eCS 1.1 GA englisch wird jetzt ausgeliefert