|
|||||||||
|
|||||||||
Related Syntax | |||||||||
control structure | using ... item |
Syntax
using shelf-name[n] action using shelf-name item n action
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 |
---- |