swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  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 ] [ OMX ] [ OMX ] [ ERRORS ]

Generated: August 11, 2000 at 3:07:49 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.