|
|||||
|
|||||
Related Syntax | Related Concepts | ||||
declaration/definition |
escape |
Syntax
escape quoted-character
Allows a new character to be used to indicate a special character or a format item, rather than the normal
%
. The use of escape
is deprecated in general, because it leads to non-standard OmniMark code that can be difficult to understand.
There can only be one escape declaration, which must come immediately after the translation type. If there is no translation type, escape
must be the first declaration in the program.
Care should be taken in choosing the special character, in case it is misunderstood as something else by a reader.
As well, some characters are poor choices for the escape character because they prevent certain format items or characters from being entered. For example, if the apostrophe '
were the escape character, a string could not be bounded by apostrophes. The reason is that within the string apostrophes would be interpreted as escapes or, if doubled, as apostrophe characters, and there would be no way of ending a string.
The following code illustrates the use of the escape
declaration. Here it is used to designate the #
as the escape character, replacing the default %
symbol:
down-translate escape "#" translate "%" ; This would normally be "%%" local integer n set n to 3 output "#"#d(n)#"" ; This would normally be "%"%d(n)%""
Related Syntax declare heralded-names process |
Related Concepts Format items |