next up previous
Next: astSetActiveUnit - Specify how the Unit attribute should be used
Up: AST Function Descriptions
Previous: astSet - Set attribute values for an Object

   
astSet<X> - Set an attribute value for an Object

Description:
This is a family of functions which set a specified attribute value for an Object using one of several different data types. The type is selected by replacing <X> in the function name by C, D, F, I or L, to supply a value in const char* (i.e. string), double, float, int, or long format, respectively.

If possible, the value you supply is converted to the type of the attribute. If conversion is not possible, an error will result.

Synopsis:
void astSet<X>( AstObject *this, const char *attrib, <X>type value )

Parameters:
this
Pointer to the Object.
attrib
Pointer to a null-terminated character string containing the name of the attribute whose value is to be set.
value
The value to be set for the attribute, in the data type corresponding to <X> (or, in the case of astSetC, a pointer to a null-terminated character string containing this value).

Class Applicability:
Object
These functions apply to all Objects.

Examples:
astSetI( frame, "Preserve", 1 );

Sets the Preserve attribute value for Object "frame" to 1.

astSetC( plot, "Format(1)", "%.2g" );

Sets the Format(1) attribute value for Object "plot" to the character string "%.2g".

Notes:
  • Attribute names are not case sensitive and may be surrounded by white space.
  • An error will result if an attempt is made to set a value for a read-only attribute.



next up previous
Next: astSetActiveUnit - Specify how the Unit attribute should be used
Up: AST Function Descriptions
Previous: astSet - Set attribute values for an Object

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils