groff
[Top][All Lists]
Advanced

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

Re: [Groff] conditionals


From: Larry Kollar
Subject: Re: [Groff] conditionals
Date: Tue, 1 Jun 2010 07:38:12 -0400


Larry McVoy wrote:

.if !\n[EULA]=0 \{\
.if !\n[EULA]=1 \{\
.if !\n[EULA]=2 \{\
.if !\n[EULA]=3 \{\
.ab No EULA defined
.\}
.\}
.\}

If I remember correctly, EULA will return 0 if not previously defined, so you'll never reach the abort. You can do this in one line:

.if !rEULA .ab No EULA defined


Anyway, the doc is full of

        .if \n[EULA]=1 \{\

etc.

What I would oh-so-love to be able to do is

        .if \n[EULA]=1 || \n[EULA]=3

I wandered through the groff docs and didn't see any way to do that.

It's defined in groff(7), and in sec. 5.3 of the texinfo doc. Logical OR is a colon:

.if \n[EULA]=1:\n[EULA]=3 \{\

It would have been interesting to ask Joe O why a colon instead of a pipe here. Anyway, I use constructs like this all the time in my docs.


Hope this helps,

        (the other) Larry



reply via email to

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