Skip to content

Commit d895b77

Browse files
committed
doc: add additional builtin macros to the manual
Manual entries for keepleft_, keepright_, takeleft_, takeright_.
1 parent 9ad0633 commit d895b77

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

doc/manual/prepro.tex

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,33 @@ \section{The preprocessor variables}
125125
string value will be substituted.
126126

127127
\noindent Preprocessor variables can have arguments and thereby become
128-
macro's. One should consult the description of the \#define~\ref{predefine}
128+
macros. One should consult the description of the \#define~\ref{predefine}
129129
instruction about the delayed substitution feature to avoid the value of
130130
the preprocessor variables in the macro would be substituted immediately
131131
during the definition. Hence proper use is
132132
\begin{verbatim}
133133
#define EXCHANGE(x,y) "Multiply replace_(`~x',`~y',`~y',`~x');"
134134
\end{verbatim}
135135

136-
\noindent \FORM{} has the following built in macro's:
136+
\noindent \FORM{} has the following built in macros:
137137
\begin{description}
138138
\item[TOLOWER\_(string)] in which the character string in the argument is
139139
converted to lower case. After this it will become input.
140140
\item[TOUPPER\_(string)] in which the character string in the argument is
141141
converted to upper case. After this it will become input.
142142
\end{description}
143-
It is anticipated that some more macro's will become available to allow for
144-
the editing of names of variables.
143+
as well as macros which allow one to edit the names of variables,
144+
\begin{description}
145+
\item[KEEPLEFT\_(string,n)] keep only the first n characters of string.
146+
After this it will become input.
147+
\item[KEEPRIGHT\_(string,n)] keep only the last n characters of string.
148+
After this it will become input.
149+
\item[TAKELEFT\_(string,n)] remove the first n characters of string.
150+
After this it will become input.
151+
\item[TAKERIGHT\_(string,n)] remove the last n characters of string.
152+
After this it will become input.
153+
\end{description}
154+
Note that these macro names are not case sensitive.
145155

146156
%--#] The preprocessor variables :
147157
%--#[ Calculator :
@@ -700,7 +710,7 @@ \section{\#define}
700710
is allowed. The parameters should be referred to inside a pair of `' as
701711
with all preprocessor variables. A special feature is the socalled
702712
delayed\index{delayed substitution}
703-
substitution\index{substitution!delayed}. With macro's like the above the
713+
substitution\index{substitution!delayed}. With macros like the above the
704714
question is always {\sl when} a preprocessor variable will be substituted.
705715
Take for instance
706716
% THIS EXAMPLE IS PART OF THE TESTSUITE. CHANGES HERE SHOULD BE APPLIED THERE AS

0 commit comments

Comments
 (0)