This function writes/updates attributes in the grid. If the attribute does not exist, it is created. If it does exist, then the value(s) is (are) updated.
Result = EOS_GD_WRITEATTR( gridID, attrname, datbuf [, COUNT=value] [, HDF_TYPE=value] )
Returns SUCCEED(0) if successful and FAIL(–1) otherwise.
Grid id (long) returned by EOS_GD_CREATE or EOS_GD_ATTACH.
Attribute name (string).
Attribute values. If HDF_TYPE is specified, the IDL variable is first converted to the type specified by the keyword before being written.
Number of values to store in attribute (long).
HDF data type of attribute (long).
In this example. we write a single precision (32 bit) floating point number with the name “ScalarFloat” and the value 3.14:
f32 = 3.14
status = EOS_GD_WRITEATTR(gridid, "ScalarFloat", f32)
We can update this value by simply calling the function again with the new value:
f32 = 3.14159
status = EOS_GD_WRITEATTR(gridid, "ScalarFloat", f32)
5.2 |
Introduced |