swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax   Related Concepts  
declaration/definition   escape    

Syntax

  escape quoted-character


Purpose

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
 
----

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:07:12 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.