swirl
Guide to OmniMark 7   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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:46:00 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.