OMget_data_type and OMset_data_type
Synopsis
int OMget_data_type (
OMobj_id object_id,
int *data_type );
int OMset_data_type (
OMobj_id object_id,
int data_type );
Description
OMget_data_type gets an object's data type.
OMset_data_type sets an objects' data type. This routine is used to convert an object defined as type prim into an object of type int, float, etc.
Arguments
object_id
The id of an object.
data_type
For OMget_data_type, an output argument containing the object's data type.
For OMset_data_type an input argument defining the objects' new type.
data_type specifies the integer code for the data type. AVS/Express provides the following symbolic constants, defined in <avs/om.h>:
Type
|
Meaning
|
OM_TYPE_CHAR |
Character |
OM_TYPE_BYTE |
Byte |
OM_TYPE_SHORT |
Short integer |
OM_TYPE_INT |
Integer |
OM_TYPE_FLOAT |
Single-precision floating point |
OM_TYPE_DOUBLE |
Double-precision floating point |
OM_TYPE_PTR |
Pointer |
OM_TYPE_STRING |
Character string |
OM_TYPE_UNSET |
Not set, e.g., its type is prim. |
Returned value
The status code (see Return Status ).
Example
/* Get object var1_id's data type and call the
appropriate routine to process the variable. */
OMobj_id var1_id;
int status;
int var1_data_type;
...
status = OMget_data_type(var1_id, &var1_data_type);
if(var1_data_type == OM_TYPE_INT)
process_integer(var1_id);