473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

K&R 5-11 ( a little OT)

Hi all,
May I ask this before I dive into this exercise which deals with Tabs.

Given a "tab stop" of , for example 8.

Does this mean that at every multiple of 8, a character would be
printed if that tab stop were chosen.

So, with the cursor at the beginning of a new line, and a "Tab Tab 'm'
", 'm' would be in the 16th column ( or be the 16th character?)

Thanks.

Nov 13 '07 #1
6 1484
In article <2007111218441716807-mdeh@comcastnet>,
mdeh <md**@comcast.netwrote:
>May I ask this before I dive into this exercise which deals with Tabs.
>Given a "tab stop" of , for example 8.
>Does this mean that at every multiple of 8, a character would be
printed if that tab stop were chosen.
Not exactly. A tab stop is defined only for a particular position.
If you say that you have "a tab stop of 8", then column 8 is the
only column thereby specified as having a stop.

It is not completely uncommon for people to specify that there
is a tab stop "every" 8, which would be closer to the situation
you describe.

Though, keep in mind that you might tab to somewhere and then
proceed with some other kind of whitespace such as spaces.
Semantically, most people would say that if there is a space
at column 8, that no character has been "printed" there.

Tab stops indicate where forward tab motion would end. What happens
after that depends upon what gets output at that point.

>So, with the cursor at the beginning of a new line, and a "Tab Tab 'm'
", 'm' would be in the 16th column ( or be the 16th character?)
In that case, 'm' would be the third character, and would show up
in the 16th column.
--
"History is a pile of debris" -- Laurie Anderson
Nov 13 '07 #2
On 2007-11-12 18:53:44 -0800, ro******@ibd.nrc-cnrc.gc.ca (Walter
Roberson) said:
In article <2007111218441716807-mdeh@comcastnet>,
mdeh <md**@comcast.netwrote:
>Does this mean that at every multiple of 8, a character would be
printed if that tab stop were chosen.

Not exactly. A tab stop is defined only for a particular position.
If you say that you have "a tab stop of 8", then column 8 is the
only column thereby specified as having a stop.

OK...
>
>So, with the cursor at the beginning of a new line, and a "Tab Tab 'm'
", 'm' would be in the 16th column ( or be the 16th character?)

In that case, 'm' would be the third character, and would show up
in the 16th column.
Thank you.


Nov 13 '07 #3
Walter Roberson wrote:
In article <2007111218441716807-mdeh@comcastnet>,
mdeh <md**@comcast.netwrote:
>So, with the cursor at the beginning of a new line, and a "Tab Tab 'm'
", 'm' would be in the 16th column ( or be the 16th character?)

In that case, 'm' would be the third character, and would show up
in the 16th column.
In my editor, with a tab stop every 8th position, it would be in the
17th column. I think that would be true of most "tab every Nth"
implementations.

--
Thad
Nov 13 '07 #4
On 2007-11-12 21:51:28 -0800, Thad Smith <Th*******@acm.orgsaid:
Walter Roberson wrote:
>In article <2007111218441716807-mdeh@comcastnet>,
mdeh <md**@comcast.netwrote:
>>So, with the cursor at the beginning of a new line, and a "Tab Tab 'm'
"....snip
In that case, 'm' would be the third character, and would show up
in the 16th column.

In my editor, with a tab stop every 8th position, it would be in the
17th column. I think that would be true of most "tab every Nth"
implementations.
Does this mean a Tab is a single character that occupies a varying
number of bytes which will bring it to the next Tab Stop. So, the next
character will occupy the first byte? after the stop. ( In a single
byte language?)

Nov 13 '07 #5
In article <2007111304410116807-mdeh@comcastnet>,
mdeh <md**@comcast.netwrote:
>Does this mean a Tab is a single character that occupies a varying
number of bytes which will bring it to the next Tab Stop.
No, it occupies a varying length on the screen or paper. With a
fixed-width font, you could say it occupies a varying number of
display positions. It's the output device that interprets it. Bytes
don't come into it at all.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Nov 13 '07 #6
mdh
On Nov 13, 4:42 am, rich...@cogsci.ed.ac.uk (Richard Tobin) wrote:
In article <2007111304410116807-mdeh@comcastnet>,

mdeh <m...@comcast.netwrote:
Does this mean a Tab is a single character that occupies a varying
number of bytes which will bring it to the next Tab Stop.

No, it occupies a varying length on the screen or paper. With a
fixed-width font, you could say it occupies a varying number of
display positions. It's the output device that interprets it. Bytes
don't come into it at all.

Thanks for clarifying.

Nov 13 '07 #7

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

Similar topics

9
by: Collin VanDyck | last post by:
I have a basic understanding of this, so forgive me if I am overly simplistic in my explanation of my problem.. I am trying to get a Java/Xalan transform to pass through a numeric character...
1
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a...
0
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a...
4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
11
by: Jeremy | last post by:
How can one stop a browser from converting &amp; to & ? We have a textarea in our system wehre a user can type in some html code and have it saved to the database. When the data is retireved...
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
12
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b)...
7
by: John Nagle | last post by:
I've been parsing existing HTML with BeautifulSoup, and occasionally hit content which has something like "Design & Advertising", that is, an "&" instead of an "&amp;". Is there some way I can get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.