swirl
Guide to OmniMark 7   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
   new
   set
 
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.