[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] condition: OR of two string comparisons
From: |
hohe72 |
Subject: |
[Groff] condition: OR of two string comparisons |
Date: |
Thu, 6 Nov 2014 02:11:00 +0100 |
Hi, I wonder if this sample, that demonstrates OR of two string
comparisons, are an recommend way to code such conditions, avoiding an
extra macro or code doubling.
Regards Holger
.\" I found this for strings
.ds c "
.ds d "
.if '\*c'foo' .ds d "bar
.ie '\*d'bar' .tm *9: true
.el .tm *9: false
.ds c "foo
.ds d "
.if '\*c'foo' .ds d "bar
.ie '\*d'bar' .tm *10: true
.el .tm *10: false
.ds c "
.ds d "bar
.if '\*c'foo' .ds d "bar
.ie '\*d'bar' .tm *11: true
.el .tm *11: false
.ds c "foo
.ds d "bar
.if '\*c'foo' .ds d "bar
.ie '\*d'bar' .tm *12: true
.el .tm *12: false
.\" and was successful at numbers:
.nr a 0
.nr b 0
.ie ((\na=1) : (\nb=2)) .tm n1: true
.el .tm n1: false
.nr a 1
.nr b 0
.ie ((\na=1) : (\nb=2)) .tm n2: true
.el .tm n2: false
.nr a 0
.nr b 2
.ie ((\na=1) : (\nb=2)) .tm n3: true
.el .tm n3: false
.nr a 1
.nr b 2
.ie ((\na=1) : (\nb=2)) .tm n4: true
.el .tm n4: false
- [Groff] condition: OR of two string comparisons,
hohe72 <=
- Re: [Groff] condition: OR of two string comparisons, Ralph Corderoy, 2014/11/06
- Re: [Groff] condition: OR of two string comparisons, hohe72, 2014/11/07
- Re: [Groff] condition: OR of two string comparisons, Ralph Corderoy, 2014/11/07
- Re: [Groff] condition: OR of two string comparisons, Werner LEMBERG, 2014/11/07
- Re: [Groff] condition: OR of two string comparisons, Dale Snell, 2014/11/07
- Re: [Groff] condition: OR of two string comparisons, hohe72, 2014/11/12
- Re: [Groff] condition: OR of two string comparisons, Steffen Nurpmeso, 2014/11/13
- Re: [Groff] condition: OR of two string comparisons, Tadziu Hoffmann, 2014/11/13
- Re: [Groff] condition: OR of two string comparisons, Ralph Corderoy, 2014/11/13
- Re: [Groff] condition: OR of two string comparisons, Steffen Nurpmeso, 2014/11/13