RossNet

FunnelWeb

Reference

Developer

Tutorial
1 Introduction
2 Macros
3 Typesetting
4 Example
5 Hints
6 Examples
7 Webmaking

SEARCH
FunnelWeb Tutorial Manual

5.13 TABs

FunnelWeb is designed to protect its user from spurious non-printable characters that might creep into a source file, and so it classifies any occurrence of such a character as an error.

FunnelWeb's idea of printable is any character in the range ASCII [32..126]. A number of people have complained about this, saying that they want to include 8-bit characters in their FunnelWeb input files. Currently there is no fix for this except to insert characters explicitly into the output using a @^ sequence (see the FunnelWeb Reference Manual for more details).

In particular, FunnelWeb flags TAB characters in its input file as errors because TABs are essentially invisible control characters with very poorly-defined semantics; it's FunnelWeb's job to keep an eye on the input file to ensure that the programmer doesn't get any nasty surprises and as TABs can cause several kinds of surprises, they are excluded.

A lot of people have complained about this aspect of FunnelWeb. Unfortunately, this issue has not yet been resolved. If you actually need  TABs in the output file (e.g. for a makefile), then you should insert TABs explicitly using a @^D(009) sequence (see the FunnelWeb Reference Manual for more details).

The following C program removes TABs. The program was kindly donated by John Skaller. Warning: This program doesn't have any error checking.

/* UNTAB Program                                            */
/* =============                                            */
/* Author       : John Skaller (maxtal@extro.ucc.su.oz.au) */
/* Organization : MAXTAL P/L 6 Mackay St ASHFIELD 2131.     */
/* Usage        : untab 2 outfile                  */
/* Status       : Public domain.                            */

#include 

int main(int argv, char **argc)
{
        int n=2;
        if(argv==2)sscanf(argc[1],"%d",&n);
        int ch=getchar();
        int column=0;
        while(ch!=-1){
                if(ch=='\n'){putchar('\n'); column=0;}
                else if(ch==9){
                        putchar(' '); column++;
                        while(column % n){putchar(' '); column++;}
                }
                else { putchar(ch); column++;}
                ch=getchar();
        }
}

Prev Up Next


Webmaster    Copyright © Ross N. Williams 1992,1999. All rights reserved.