473,545 Members | 1,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is formfeed

how does the '\f' affect output?
in what situation will I use '\f' ?

--
¶À¤l¹Å½×¼Æ¾Ç®a:

¡u¼Æ¾Ç®a¤@¥Í¥u· d¨â¼ËªF¦è¡G¤£¬O ·d¼Æ¾Ç´N¬O·d¤k¤ H¡C
¦ý¬O§Ú¤£¬O¼Æ¾Ç® a¡K¡v

Nov 13 '05 #1
8 20837
Chun-Chieh Wang <sh***@es01.adm .nctu.edu.tw> wrote in
news:be******** ***@netnews.csi e.NCTU.edu.tw:
how does the '\f' affect output?
in what situation will I use '\f' ?


If sent to a printer, it *might* eject the current page. If sent to a
terminal window, it might push the text up some number of lines. In
practice, I don't think I've ever used it. Why don't you try it and see
what it does?

--
- Mark ->
--
Nov 13 '05 #2
In <be***********@ netnews.csie.NC TU.edu.tw> Chun-Chieh Wang <sh***@es01.adm .nctu.edu.tw> writes:
how does the '\f' affect output?
"Form feed" is shorthand for something like "feed a new sheet of paper
into the printer" (implicitly meaning that the current page is ejected).

Its effect on printers using continuous paper is less well defined, but
the intent is similar. Its effect on anything else is even less well
defined.
in what situation will I use '\f' ?


Seldom. Depending on the printer type and on the way you access it,
you may want to output it before closing a stream connected to the
printer. If your program doesn't talk directly to the printer, it's
probably not needed at all.

It's most useful to programs that know exactly to what kind of printer
they're talking, so they can decide when it's the right time to move to
a new page (if the decision cannot be left to the printer itself).

Another usage is in plain text files, to divide them into *logical* pages.
There is no guarantee that these logical pages will nicely map into
physical pages when the file is printed, however. When such files are
displayed on the screen, the ASCII FF character is often represented as
^L. You can type it yourself on an ASCII keyboard as CTRL-L.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #3
On 3 Jul 2003 14:14:30 GMT, Da*****@cern.ch (Dan Pop) wrote:
In <be***********@ netnews.csie.NC TU.edu.tw> Chun-Chieh Wang <sh***@es01.adm .nctu.edu.tw> writes:
how does the '\f' affect output?


"Form feed" is shorthand for something like "feed a new sheet of paper
into the printer" (implicitly meaning that the current page is ejected).

Its effect on printers using continuous paper is less well defined, but
the intent is similar. Its effect on anything else is even less well
defined.


Cutsheet printers are a much more recent invention than the form-feed character
is. On mainframe line printers (continious paper printers), the form-feed
character typically caused the printer to advance the paper to the top of the
next page (delimited by the perforations that seperated one page from another,
and governed by a 'print control tape' or 'print control chain' or even a
"UCB"). Even on my old ASR33 printer (with pin feed), the form-feed character
caused the printer to advance to (what it considered to be) the top of the page
(in this case, governed by a metal setpost on a cam, mounted on the pinfeed
drive).

In any case, the '\f' sequencee in C does none of these things; it simply causes
the compiler to substitute the appropriate form-feed character (or character
sequence) (in the hosted characterset) into the data stream. /How/ that
form-feed character (or sequence) is interpreted is undefined to C, and could
cause the launching of an ICBM instead of the advancement of a piece of paper
(should the external environment interpret it in that manner).
--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')
Nov 13 '05 #4
On Thu, 3 Jul 2003, Chun-Chieh Wang wrote:
how does the '\f' affect output?
in what situation will I use '\f' ?


The '\f' character is a form feed. It moves the active position to the
start of the next logical page. If you are sending it to a cut sheet
printer it might make the printer eject the current sheet. If it is to a
continuous feed printer it might make the printer advance to the next
perforation mark on the roll. If there is no performation mark then it
will advance to whatever the printer driver detemines is the start of the
next page.

Beyond the examples given, it is really open to interpretation. I could
program my terminal display such that a form feed means clear the screen.

Obviously since it comes from the days when output went to a teletype or
printer, it really only makes sense when you are outputting to a printer.
Even then, output to a printer tends to be unportable so you wouldn't
necessarily use stdio. So, realistically, you might never use '\f'
character. Last time I used it was some 15 or 20 years ago.

--
main(){int j=1234;char t[]=":@abcdefghijk lmnopqrstuvwxyz .\n",*i=
"iqgbgxmdbjlgdv .lksrqek.n";cha r *strchr(const char *,int);while(
*i){j+=strchr(t ,*i++)-t;j%=sizeof t-1;putchar(t[j]);} return 0;}

Nov 13 '05 #5
On 3 Jul 2003 12:52:27 GMT, in comp.lang.c , "Mark A. Odell"
<no****@embedde dfw.com> wrote:
Chun-Chieh Wang <sh***@es01.adm .nctu.edu.tw> wrote in
news:be******* ****@netnews.cs ie.NCTU.edu.tw:
how does the '\f' affect output?
in what situation will I use '\f' ?


If sent to a printer, it *might* eject the current page. If sent to a
terminal window, it might push the text up some number of lines.


and it might also print either a little arrow with an f next to it, or
a looking-glass (windows apps do both of these, when the mood takes
them).

All of these are possible, because the interpretation of escape
sequences is implementation defined.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 13 '05 #6
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
Nov 13 '05 #7

Chun-Chieh Wang <sh***@es01.adm .nctu.edu.tw> wrote in message
news:be******** ***@netnews.csi e.NCTU.edu.tw.. .
how does the '\f' affect output?
That depends upon the target device.
in what situation will I use '\f' ?


When the device to which you have a stream
attached has assigned a particular meaning
to '\f' which you find useful. Example:
some printers will eject a page when receiving
a '\f' character.

Depending upon the applications you write, you
might indeed never use '\f'. It's been a long
while since I've used it myself.

-Mike


Nov 13 '05 #8
Le*********@td. com (Lew Pitcher) writes:
In any case, the '\f' sequencee in C does none of these things; it simply causes
the compiler to substitute the appropriate form-feed character (or character
sequence) (in the hosted characterset) into the data stream. /How/ that
form-feed character (or sequence) is interpreted is undefined to C, and could
cause the launching of an ICBM instead of the advancement of a piece of paper
(should the external environment interpret it in that manner).


As could any character, including plain old ordinary printable
characters, etc., as the interpretation of a character by the host
environment is completely outside of the scope of the C language (and
its standard). However, the standard does put forth the *intended*
interpretation for "\f", so I think we're pretty safe for that :-)

-Micah
Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3062
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is burns. Here is the code: $frank = "burns";
220
18828
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it...
699
33349
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro capabilities, unfortunately. I'd like to know if it may be possible to add a powerful macro system to Python, while keeping its amazing syntax, and if it...
92
6343
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption? cheers, reed
137
6968
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very pragmatic - 3) I usually move forward when I get the gut feeling I am correct - 4) Most likely because of 1), I usually do not manage to fully explain...
5
2214
by: PW | last post by:
I'm creating an ASP to print labels for a client. How do you send a formfeed to the printer ?
12
11130
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error { public: string desc;
4
18344
by: Greenhorn | last post by:
Hi, Can i know how formfeed exactly works, also vertical tab, i have used vertical tab with printf() as shown below: printf("This is the \v line"); the output: This is the ♂ line
1
2597
by: Dave Cullen | last post by:
How do I force a new page when printing with PrintDocument? I put a vbFormFeed in there after my footer and it gets ignored. Thanks Dave
0
7416
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7676
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7442
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6001
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5347
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4965
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3456
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
729
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.