groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] String editing?


From: Ted Harding
Subject: RE: [Groff] String editing?
Date: Fri, 11 Feb 2000 09:36:53 -0000 (GMT)

On 11-Feb-00 Konovalov, Vadim wrote:
> Sure there *are* string editing functions in groff:
> .substring str \n[start] \n[end]  \" groff only
> .as ...... \" both troff and groff
> 
> Consider following test:
> .ds str <this
> .tm [\*[str]]
> .ds sstr \*[str]
> .substring sstr 2
> .tm [\*[sstr]]
> .ds sstr \*[str]
> .substring sstr 2 3
> .tm [\*[sstr]]
> 
> this outputs following on STDERR:
> [<this]
> [this]
> [t]
> 
> If \n[start] or \n[end] are negative values then position in
> macro/string is
> calculated from its end

Well, you are right, and one learns something all the time!

However, this is nowhere documented that I can see. How did you find out?

(I knew about .as, but I don't regard this as prime-time string
editing; the fundamental need is to unpack a string according to
requirements, and "substring" is a fundamental primitive for this)

I must admit I had been misled by the following in James Clark's
TODO file in the groff-1.11 sources:

  Better string-processing support (substring, length, search).

which, with the absence of reference to any such thing in the
documentation, led me to suppose it wasn't functional! There
still seems to be no provision for the remainder, however
(unless anyone out there knows different).

Anyway, thanks. This opens up some possibilities.

Best wishes, and many thanks for your contribution.
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Date: 11-Feb-00                                       Time: 09:36:53
------------------------------ XFMail ------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]