next up previous 225
Next: Null and locum values
Up: Features of the library
Previous: Features of the library

Copying parameters and fields

Parameters and fields have a defined data type (_DOUBLE, _REAL etc.). Families of subroutines are available for transferring the values of parameters, columns and fields between a catalogue and Fortran variables in an application program invoking the CAT interface. These Fortran variables may be of a variety of types. The type of the column or parameter need not correspond to the type of the Fortran variable; the interface will automatically attempt a type conversion. However, depending on the types involved, a conversion may not be possible for some values. The matrix of possibilities is shown in Table [*]. This matrix is used for all conversions: both GET and PUT operations for both columns (or fields) and parameters.


Table: Conversion matrix for copying different types

Destination Start or initial type
type UBYTE BYTE UWORD WORD INTEGER REAL DOUBLE LOGICAL CHAR
UBYTE yes maybe maybe maybe maybe maybe maybe yes maybe
BYTE maybe yes maybe maybe maybe maybe maybe yes maybe
UWORD yes yes yes maybe maybe maybe maybe yes maybe
WORD yes yes maybe yes maybe maybe maybe yes maybe
INTEGER yes yes yes yes yes maybe maybe yes maybe
REAL yes yes yes yes yes yes maybe yes maybe
DOUBLE yes yes yes yes yes yes yes yes maybe
LOGICAL yes yes yes yes yes yes yes yes yes
CHAR maybe maybe maybe maybe maybe maybe maybe yes maybe

Key:

yes
conversion is always possible,

maybe
conversion may be possible.

Note that converting a character string to a character string may result in an error because truncation may occur.


If a type conversion fails the appropriate exception value (null or locum, see Section [*], below) is substituted for the missing value. The error status is not set (that is, it remains ok) and no error message is generated. This procedure is followed consistently for all type conversions. It is adopted because, in practice, conversion failures are common.

The rules for converting to and from the _LOGICAL data type are as follows

From logical
 

To logical
 



next up previous 225
Next: Null and locum values
Up: Features of the library
Previous: Features of the library

CAT [1ex
Starlink User Note 181
A.C. Davenhall
4th April 2001
E-mail:ussc@star.rl.ac.uk

Copyright © 2001 Council for the Central Laboratory of the Research Councils