astMapPutElem <X >

Put a value into an element of a vector value in a KeyMap

Description:

This is a set of functions for storing a value in a single element of a vector value in a KeyMap. You should replace <X > in the generic function name astMapPutElem <X > by an appropriate 1-character type code (see the " Data Type Codes" section below for the code appropriate to each supported data type). The supplied value is converted from the data type indicated by <X > to the data type of the KeyMap entry before being stored (an error is reported if it is not possible to convert the value to the required data type).

Synopsis

void astMapPutElem <X >( AstKeyMap this, const char key, int elem, <X >type value )

Parameters:

this
Pointer to the KeyMap.
key
The character string identifying the value to be retrieved. Trailing spaces are ignored. The supplied string is converted to upper case before use if the KeyCase attribute is currently set to zero.
elem
The index of the vector element to modify, starting at zero.
value
The value to store.

Applicability

KeyMap
If the " elem" index is outside the range of the vector, the length of the vector will be increased by one element and the supplied value will be stored at the end of the vector in the new element.
Table
If the " elem" index is outside the range of the vector, an error will be reported. The number of elements in each cell of a column is specified when the column is created using astAddColumn.

Notes:

Data Type Codes

To select the appropriate function, you should replace <X > in the generic function name astMapPutElem <X > with a 1-character data type code, so as to match the data type <X >type of the data you are processing, as follows:

For example, astMapPutElemD would be used to put a " double" value, while astMapPutElemI would be used to put an " int" value, etc. For D or I, the supplied " value" parameter should be a double or int. For C, the supplied " value" parameter should be a pointer to a character string. For A, the supplied " value" parameter should be an AstObject pointer.