On Sun, Apr 01, 2018 at 07:34:44AM +0200, Werner LEMBERG wrote:
> And here (hopefully!) a final version that properly takes the `.g'
> flag into account.
Thanks! I've applied this (with one refinement: I added ".rm Ystring"
to the end, for hygiene).
--
Colin Watson
> Or even simpler
>
> .ds Ystring \n[.Y]
> .while (\B'\*[Ystring]' = 0) .chop Ystring
> .
> .if (\n[.g] \
>& ((\n[.x] > 1) \
> : ((\n[.x] == 1) & (\n[.y] > 20)) \
> : ((\n[.x] == 1) & (\n[.y] == 20) & (\*[Ystring] >= 2 \{\
> . warn (\n[.warn] - (\n[.warn
> Here it is.
>
> .ds Ystring \n[.Y]
> .while (\B'\*[Ystring]' = 0) .chop Ystring
> .nr Ynumber \*[Ystring]
> .
> .if (\n[.g] \
>& ((\n[.x] > 1) \
> : ((\n[.x] == 1) & (\n[.y] > 20)) \
> : ((\n[.x] == 1) & (\n[.y] == 20) & (\n[Ynumber] >= 2 \{\
> . warn
> In groff 1.22.4.rc2:
>
> $ echo '\n[.Y]' | nroff | grep .
> 4.rc2
>
> I can see why this happens, of course; but it seems odd for a number
> register to contain non-numeric data.
Not at all. There are many number registers that return strings.
> Failing that, can anyone suggest an improv
In groff 1.22.4.rc2:
$ echo '\n[.Y]' | nroff | grep .
4.rc2
I can see why this happens, of course; but it seems odd for a number
register to contain non-numeric data. Would it be better to change this
to chop off the dot and everything after it?
Failing that, can anyone suggest an improved