swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
pattern  

value-end, =|

 
 

Syntax

value-end


Purpose

value-end is a positional pattern recognized at the end of a scanned value.

Two forms of the value-end pattern are available - the long form and the short form, =|. You should use whatever form leads to the most readable code. For instance, in the following do scan (where every match alternative is guarded by a value-end to ensure that only whole values are matched) it is clearly preferable to use the short form:

  do scan cgi-data{"PATH_INFO"} 
      drop ~cgi-data{"SCRIPT_NAME"}
        match "/login" =|
           login-page
        match "/guess" =|
           guess-page
        else
           new-page
     done

But in the following match statement (that matches any characters up to the next comma or the end of the text), the long form is clearly preferable:

  match any** ("," | value-end)

The short form next to the "or" operator (|)would make a pattern that was hard to read:

  match any** ("," | =|)

    Related Syntax
   do scan
   repeat scan
 
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.