KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q36580: How Tabs Are Treated in the Microsoft Editor

Article: Q36580
Product(s): See article
Version(s): 1.00   | 1.00
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 14-OCT-1988

Problem:

Some text editors preserve tab characters automatically. These editors
maintain tabs (ASCII 9 characters) as they are stored in a file, and
distinguish between tab characters and spaces.

The Microsoft Editor translates tab characters into spaces. This
behavior only affects lines that you modify. If you load and save a
file without changing any lines of text, the lines are written back to
disk with all tab characters and spaces intact. Only the modified
lines are affected by this conversion.

It is not possible to disable this translation of tab characters into
spaces in a modified line.

In the Microsoft Editor, "tab"  is both a function name and the name
of a key. The TAB key is assigned to the tab function by default. As a
function, tab is nothing more than a move-to-next-column movement
function. The placement of columns in determined by the TABSTOPS
switch.

When ever you edit a line, tab characters are translated to space
characters using the FILETAB switch. So modified lines in the file are
stored in the editor with spaces only. The FILETAB switch determines
how the editor translates tab characters to spaces when reading in a
line of text. If ENTAB is set to 1 or 2, then FILETAB also determines
how the editor translates spaces to tabs when you save the file to
disk. (Again, only modified lines are affected.)

If you need to view the tabs as they are situated in your file you can
use the TABDISP switch to show you which spaces will be compressed
into a tab character at the next write to the disk file.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.