OMget_int_val

OMset_int_val

OMget_name_int_val

OMset_name_int_val


Synopsis



int  OMget_int_val (
OMobj_id  object_id,
int  *value  );

int  OMset_int_val (
OMobj_id  object_id,
int  value  );

int  OMget_name_int_val (
OMobj_id  object_id,
OMobj_name  subobject_name,
int  *value  );

int  OMset_name_int_val (
OMobj_id  object_id,
OMobj_name  subobject_name,
int  value  );

int  OMXobj::get_int_val( int *value  );

int OMXobj::set_int_val( int value  );

Description

These routines get and set an integer object's value.

The routines access the target object in different ways.

The routines...

 

access...

 

OMget_int_val
OMset_int_val

An object identified by id

OMget_name_int_val
OMset_name_int_val

A named subobject of an object

OMXobj::get_int_val
OMXobj::set_int_val

A method on the OMXobj corresponding to the object

 

Arguments

object_id

The id of an object.

subobject_name

The name of one of object_id 's immediate subobjects.

value

In OMget_int_val and OMget_name_int_val, an output argument containing the object's value.

In OMset_int_val and OMset_name_int_val, an input argument specifying the new value.

Returned value

The status code (see Return Status ).

Example 1


/* Get and set object var1_id's value. */
OMobj_id  var1_id;
int status;
int var1_value;
...
status = OMget_int_val(var1_id, &var1_value);
if (status == 1) {
var1_value *= 2;
status = OMset_int_val(var1_id, var1_value);
}

Example 2


/* Get the value of object x, an integer subobject of
  grp1_id. */
OMobj_id  grp1_id;
int status;
int x_value;
...
status = OMget_name_int_val(var1_id, OMstr_to_name("x"),
&x_value);