swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
     

Data types

Basic types

OmniMark offers four basic data types:

Sources and sinks

OmniMark also provides source and sink data types to support streaming of data:

Stream data type

There is one more data type built into OmniMark itself:

The stream data type can be described as a union of string and string sink types. A variable declared as stream acts as a string when closed, and as a string sink when open.

Records

You can define complex data types using records.

Opaque data types

You may declare a variable of any opaque data type implemented in an external library. Some of the external libraries that come with OmniMark implement various opaque data types. Some examples of opaque data types are:

Numeric types

Integer, BCD, and float are all numeric data types. How do you choose the appropriate numeric type for the data you are dealing with?

Are you dealing with whole number quantities with no fractional parts? If so, choose integer or BCD. Integer has marginally simpler syntax, but a limited size. Use BCD if numbers could get bigger than an integer can handle. It is also slightly easier to do arithmetic and comparisons between numbers of the same data type, so choose BCD for integer values that will be involved in calculations with other BCD values.

Are you dealing with numerical quantities with fractional parts? If so, choose BCD unless one of the following conditions applies:

In any of the above cases, use float.

When in doubt, use BCD.

There is no appreciable performance advantage in choosing float over BCD.

Note that you should base your choice of numerical types on the set of interacting values rather than on each value individually. Choosing numbers of the same type for all interacting numbers (unless obviously inappropriate) will simplify your code and save on data conversions. Never mix float and BCD numbers in the same calculation; doing so always involves a loss of precision.

     
 

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.