swirl Guide to OmniMark 6   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax    
control structure   using ... key    

Syntax

  using shelf-name{key-contents}]
     action

  using  shelf-name key key-contents
     action


Purpose

The current item in a shelf can be temporarily changed by the using ... key prefix, with the shelf name in place of the ellipsis, followed by the key value.

You can also use the new syntax, using shelf-name{...}, replacing shelf-name with the name of the shelf and the ellipsis with the key value. The item with the key you specified becomes the current item during the action that follows. After the action ends, the previous current item in the shelf becomes the current item.

Example:

  process
   process
     local stream poet variable initial {
                "Cohen"       with key "Leonard",
                "Angelou"     with key "Maya",
                "Yevtushenko" with key "Yevgeny",
                "Handke"      with key "Peter"
                }

     output "Using poet key 'Maya':%n"
     using poet key "Maya"
          output key of poet ||  " " || poet || "%n%n"

     output "Using poet{'Peter'}:%n"
     using poet{"Peter"}
          output key of poet ||  " " || poet || "%n%n"

  ; The above code produces the following results:
  ; 
  ;Using poet key 'Maya':
  ;Maya Angelou
  ;
  ;Using poet{'Peter'}:
  ;Peter Handke

    Related Syntax
   using ... item
 
 
----

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

OmniMark 6.5 Documentation Generated: December 23, 2002 at 6:25:44 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-2002.