swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax    
action  

set new

 
 

Syntax

set new shelf-name
   ({string-expression})? insertion-point?
   to (numeric-expression | string-expression | test-expression)


Purpose

The set new action is, essentially, a composition of the set and the new actions. It simply replaces the shelf-name part of a set action with an entire new action.

The set new action first performs the embedded new action, and then sets the value of the inserted item of the expression after the keyword to.

The type of expression appearing after the keyword to depends on the shelf type:

The insertion-point is identified using the keywords before or after.

The following program creates a variable stream shelf, then sets the first value on that shelf. A series of three set new actions is used to create and set the values of new items on that shelf:

  global stream quotes variable initial-size 1
  
  process
     set quotes to "Is this a dagger?"
     set new quotes to "To be or not to be?"
     set new quotes before [2] to "A horse!"
     set new quotes after [1] to "What light?"
     repeat over quotes
        output quotes || "%n"
     again

The output of this program is:

  Is this a dagger?
  What light?
  A horse!
  To be or not to be?

    Related Syntax
 
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:51:21 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.