[comp.text] tbl error message:line 202: Too many text block diversions

duc@cos.com (Duc Kim Nguyen) (06/29/89)

Netlanders:
	I have a simple (and long) tbl file, and could not get it
to print because of:
file.tbl: line 202: Too many text block diversions
tbl quits

Can anyone shed some light ?  Each T{ T} pair becomes a diversion ?

Thanks

duc@COS.COM

scott@dtscp1.UUCP (Scott Barman) (06/29/89)

In article <19811@cos.com> duc@cos.com (Duc Kim Nguyen) writes:
>Netlanders:
>	I have a simple (and long) tbl file, and could not get it
>to print because of:
>file.tbl: line 202: Too many text block diversions
>tbl quits
>
>Can anyone shed some light ?  Each T{ T} pair becomes a diversion ?

Oh yes!  It sure does.  Using troff it is the only way to format the text
block and find its depth and other parameters to print it.  It also allows
tbl to separate the block and position it.  If you look at the way tbl works,
it will use string variables to save data, number registers to save widths,
and diversions for text blocks.  It will not put it all together until it
sees the .TE at the end.

One of the problems is they all share the same namespace.  Therefore if you
have a diversion named ZZ you cannot have a macro named ZZ as well.  This
makes sense considering how diversions are used, but you cannot define a
string as ZZ without doing strange things to troff!

NOTE: Yes, I realize this is an argument for long names, but it is also one
for a separate namespaces.  HOWEVER, I have a version of tbl that uses
the \D draw functions to draw lines (highly more efficient) and I do not
want to make those hacks again! :-)  Now, if I can handle drawing lines
with tables breaking pages, I would be all set. :-)

-- 
scott barman
{gatech, emory}!dtscp1!scott

jjc@jclark.UUCP (James Clark) (07/01/89)

In article <809@dtscp1.UUCP> scott@dtscp1.UUCP (Scott Barman) writes:

   One of the problems is they all share the same namespace.  Therefore if you
   have a diversion named ZZ you cannot have a macro named ZZ as well.  This
   makes sense considering how diversions are used, but you cannot define a
   string as ZZ without doing strange things to troff!

   NOTE: Yes, I realize this is an argument for long names, but it is also one
   for a separate namespaces.

Separate name spaces for diversions, strings and macros are not a good
idea. It is an important feature of troff that diversions, strings and
macros not only share the same name space but are the same thing: for
example, you can use `as' or `am' on something defined with `di', or
you can interpolate with `\*' something defined with `di' or `de' For
a good example of how this can be useful have a look at how the man TP
macro works. It relies on the fact that you can do something like
this:

.di x
Label
.br
.di
.ds y \*x\
\*y Paragraph starts here on the same line as the label.

It is this sort of thing that makes implementing a troff that is input
compatible with the original not as easy as you might think.

James Clark
jjc@jclark.uucp