- %% outputs `%'
- %<EM>[[</EM>:<EM>]flags][width[.precision]][</EM>doxXs<EM>]</EM>
- as in <STRONG>printf</STRONG>, flags are [-+#] and space
- %c print pop() like %c in printf()
- %s print pop() like %s in printf()
-
- %p[1-9] push <EM>i</EM>'th parm
- %P[a-z] set dynamic variable [a-z] to pop()
- %g[a-z] get dynamic variable [a-z] and push it
- %P[A-Z] set static variable [a-z] to pop()
- %g[A-Z] get static variable [a-z] and push it
- %'<EM>c</EM>' char constant <EM>c</EM>
- %{<EM>nn</EM>} integer constant <EM>nn</EM>
- %l push strlen(pop)
-
- %+ %- %* %/ %m
- arithmetic (%m is mod): push(pop() op pop())
- %& %| %^ bit operations: push(pop() op pop())
- %= %> %< logical operations: push(pop() op pop())
- %A, %O logical and & or operations (for conditionals)
- %! %~ unary operations push(op pop())
- %i add 1 to first two parameters (for ANSI terminals)
-
- %? expr %t thenpart %e elsepart %;
- if-then-else, %e elsepart is optional.
- else-if's are possible a la Algol 68:
- %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
- ci are conditions, bi are bodies.
+ <STRONG>%%</STRONG> outputs "%"
+
+ <STRONG>%</STRONG><EM>[[</EM>:<EM>]flags][width[.precision]][</EM><STRONG>doxXs</STRONG><EM>]</EM>
+ as in <STRONG>printf</STRONG>, flags are <EM>[-+#]</EM> and <EM>space</EM>. Use a ":"
+ to allow the next character to be a "-" flag, avoid-
+ ing interpreting "%-" as an operator.
+
+ %c print pop() like %c in <STRONG>printf</STRONG>
+
+ <STRONG>%s</STRONG> print pop() like %s in <STRONG>printf</STRONG>
+
+ <STRONG>%p</STRONG><EM>[1-9]</EM>
+ push <EM>i</EM>'th parameter
+
+ <STRONG>%P</STRONG><EM>[a-z]</EM>
+ set dynamic variable <EM>[a-z]</EM> to pop()
+
+ <STRONG>%g</STRONG><EM>[a-z]/</EM>
+ get dynamic variable <EM>[a-z]</EM> and push it
+
+ <STRONG>%P</STRONG><EM>[A-Z]</EM>
+ set static variable <EM>[a-z]</EM> to <EM>pop()</EM>
+
+ <STRONG>%g</STRONG><EM>[A-Z]</EM>
+ get static variable <EM>[a-z]</EM> and push it
+
+ The terms "static" and "dynamic" are misleading.
+ Historically, these are simply two different sets of
+ variables, whose values are not reset between calls
+ to <STRONG>tparm</STRONG>. However, that fact is not documented in
+ other implementations. Relying on it will adversely
+ impact portability to other implementations.
+
+ <STRONG>%'</STRONG><EM>c</EM><STRONG>'</STRONG> char constant <EM>c</EM>
+
+ <STRONG>%{</STRONG><EM>nn</EM><STRONG>}</STRONG>
+ integer constant <EM>nn</EM>
+
+ <STRONG>%l</STRONG> push strlen(pop)
+
+ <STRONG>%+</STRONG>, <STRONG>%-</STRONG>, <STRONG>%*</STRONG>, <STRONG>%/</STRONG>, <STRONG>%m</STRONG>
+ arithmetic (%m is mod): <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM>
+
+ <STRONG>%&</STRONG>, <STRONG>%|</STRONG>, <STRONG>%^</STRONG>
+ bit operations (AND, OR and exclusive-OR): <EM>push(pop()</EM>
+ <EM>op</EM> <EM>pop())</EM>
+
+ <STRONG>%=</STRONG>, <STRONG>%></STRONG>, <STRONG>%<</STRONG>
+ logical operations: <EM>push(pop()</EM> <EM>op</EM> <EM>pop())</EM>
+
+ <STRONG>%A</STRONG>, <STRONG>%O</STRONG>
+ logical AND and OR operations (for conditionals)
+
+ <STRONG>%!</STRONG>, <STRONG>%~</STRONG>
+ unary operations (logical and bit complement):
+ push(op pop())
+
+ <STRONG>%i</STRONG> add 1 to first two parameters (for ANSI terminals)
+
+ <STRONG>%?</STRONG> <EM>expr</EM> <STRONG>%t</STRONG> <EM>thenpart</EM> <STRONG>%e</STRONG> <EM>elsepart</EM> <STRONG>%;</STRONG>
+ This forms an if-then-else. The <STRONG>%e</STRONG> <EM>elsepart</EM> is
+ optional. Usually the <STRONG>%?</STRONG> <EM>expr</EM> part pushes a value
+ onto the stack, and <STRONG>%t</STRONG> pops it from the stack, test-
+ ing if it is nonzero (true). If it is zero (false),
+ control passes to the <STRONG>%e</STRONG> (else) part.
+
+ It is possible to form else-if's a la Algol 68:
+ <STRONG>%?</STRONG> c1 <STRONG>%t</STRONG> b1 <STRONG>%e</STRONG> c2 <STRONG>%t</STRONG> b2 <STRONG>%e</STRONG> c3 <STRONG>%t</STRONG> b3 <STRONG>%e</STRONG> c4 <STRONG>%t</STRONG> b4 <STRONG>%e</STRONG> <STRONG>%;</STRONG>
+
+ where ci are conditions, bi are bodies.
+
+ Use the <STRONG>-f</STRONG> option of <STRONG>tic</STRONG> or <STRONG>infocmp</STRONG> to see the struc-
+ ture of if-then-else's. Some strings, e.g., <STRONG>sgr</STRONG> can
+ be very complicated when written on one line. The <STRONG>-f</STRONG>
+ option splits the string into lines with the parts
+ indented.