swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
declaration/definition  

record, declare record

 
 

Syntax

declare record record-type-name
   (extends record-type-name)?
   ((field field declaration)* | elsewhere)


Purpose

You can use declare record to declare a record type.

Here is how you would declare a record type to hold a simple metadata record for a document:

  declare record document-metadata
     field stream author
     field stream title
     field stream publisher
     field integer year
     field switch in-print initial {true}

Each field in the record is itself of a particular type and is declared just as a local variable of that type would be declared, substituting the word field for the word local. Each field in a record is itself a shelf.

A record declaration by itself simply defines a record type. To create a record you must create a variable of the record type.

A record can be declared as an extension of another record type, using extends:

  declare record book-metadata
    extends document-metadata
    field stream isbn-number

An extended record type inherits the fields of its base type.

The keyword elsewhere can be used record pre-definitionto make the record name and some of the properties available without defining all of the record's properties.

    Related Syntax
 
Related Concepts
 
 

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.