swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
Prerequisite Concepts      

Shelf Literals

A shelf literal is the portion of a shelf declaration following the initial keyword: much like "Hello, World!" is a string literal, 5 is a numeric literal, and true is a switch literal, so

  { "Hello, World!" with key "a", "Salut, Monde!" with key "b" }
        
is a literal value for a shelf. Note that the braces are part of the shelf literal.

A shelf can be initialized with a shelf literal:

  define string source function 
     format-numbers (read-only integer j)
  elsewhere
  
  
  process
     local integer i initial { 1, 2, 3, 4, 5 }
  
     output format-numbers (i)
        
Here, the portion following the initial keyword is a shelf literal being used to initialize the integer shelf i. However, in this case, the local integer shelf i is unnecessary, as the shelf literal itself can be passed directly to the function:
  define string source function 
     format-numbers (read-only integer j)
  elsewhere
  
  
  process
     output format-numbers ({ 1, 2, 3, 4, 5 })
        

Prerequisite Concepts
 
   
 

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

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

Copyright © Stilo International plc, 1988-2010.