swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
     
Data types

OmniMark offers six basic data 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.

OMX types

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

The counter data type has been deprecated and you are encouraged to use integer instead.

       
----

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

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

Copyright © OmniMark Technologies Corporation, 1988-2000.