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

Data types

Basic types

OmniMark offers six basic data types:

Records

You can define complex data types using records.

OMX types

In addition to these basic data types, you may declare a variable of the type of any OMX component.

Numeric types

Integer, int32, 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 creating a bit field, that is, a value that represents the on/off state of a set of bits, rather than a numerical quantity? If so, choose int32.

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.

Prerequisite Concepts
     Input functions and the markup parser
 
   
 

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

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

Copyright © Stilo Corporation, 1988-2005.