Article View: comp.text
Article #6658Re: Explain Use of <Ctrl-G>s in Macros
From: Bernie Cosell
Date: Fri, 05 Jan 1990 03:40
Date: Fri, 05 Jan 1990 03:40
20 lines
1259 bytes
1259 bytes
charly@altos86.Altos.COM (Charly Rhoades) writes: }I'm hacking troff code, and I come across a number of constructions }that use <Ctrl-G> characters, such as the examples below: Dunno about the first two, but this one: } .if^G\\$1^G2^G .if !^G\\$5^G^G .ds }i\^ is pretty standard usage. The problem is that this part of troff uses character delimited strings. So in order to work, you have to guarantee that the delimiter doesn't appear *in* the strings themselves. Now, this is mostly trivial when you are delmiting your own strings, but it becomes a bit problematic when you're writing a macro that is going to take a string from \\$1. What you have to do is pick an unlikely character to use as the in-the-macro delimiter. We used '~' for a while, and while it was readable it really wasn't acceptable. control-G is a fairly conventional char to use for that purpose. /Bernie\
Technical Details
Message-ID:
<50451@bbn.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!bbn!bbn.com!cosellReferences:
<140@altos86.Altos.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!bbn!bbn.com!cosell From: cosell@bbn.com (Bernie Cosell) Newsgroups: comp.text Subject: Re: Explain Use of <Ctrl-G>s in Macros Keywords: troff macros Message-ID: <50451@bbn.COM> Date: 5 Jan 90 03:40:30 GMT References: <140@altos86.Altos.COM> Sender: news@bbn.COM Lines: 20