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

Syntax

  using shelf-name[n]
     action

  using  shelf-name item n
     action


Purpose

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

You can also use the new syntax, using shelf-name[...], replacing shelf-name with the name of the shelf and the ellipsis with the item number. The item 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 item 1:%n"
     using poet item 1
        output poet || "%n%n"

     output "Using item poet[2]:%n"
     using poet[2]
        output poet || "%n%n"

     output "We are now outside the 'using' scope:%n"
     output poet || "%n%n"

  ; The above code produces the following results:
  ; 
  ;Using poet item 1:
  ;Cohen
  ;
  ;Using item poet[2]:
  ;Angelou
  ;
  ;We are now outside the 'using' scope:
  ;Handke
  ;

    Related Syntax
   using ... key
 
 
----

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.