- %% 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.
+
+ %% outputs `%'
+
+ %<EM>[[</EM>:<EM>]flags][width[.precision]][</EM>doxXs<EM>]</EM>
+ as in <STRONG>printf</STRONG>, flags are [-+#] and space. 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>
+
+ %s print pop() like %s in <STRONG>printf</STRONG>
+
+ %p[1-9]
+ push <EM>i</EM>'th parameter
+
+ %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
+
+ 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.
+
+ %'<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 (AND, OR and exclusive-OR): push(pop()
+ op pop())
+
+ %= %> %<
+ logical operations: push(pop() op pop())
+
+ %A, %O
+ logical AND and OR operations (for conditionals)
+
+ %! %~
+ unary operations (logical and bit complement):
+ push(op pop())
+
+ %i add 1 to first two parameters (for ANSI terminals)
+
+ %? <EM>expr</EM> %t <EM>thenpart</EM> %e <EM>elsepart</EM> %;
+ This forms an if-then-else. The %e <EM>elsepart</EM> is
+ optional. Usually the %? <EM>expr</EM> part pushes a value
+ onto the stack, and %t pops it from the stack, test-
+ ing if it is nonzero (true). If it is zero (false),
+ control passes to the %e (else) part.
+
+ It is possible to form else-if's a la Algol 68:
+ %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
+
+ 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.