Synopsis
int OMget_obj_seq (
OMobj_id object_id,
OMobj_id template_id,
int mode );
Description
OMget_obj_seq returns the sequence number of an object.
Arguments
object_id
The id of an object.
template_id
The optional id of a template object.
template_id is useful when object_id refers to an object with subobjects and the mode is OM_SEQ_SUBOBJS. See mode , below.
Typically, you set template_id to OMnull_obj to indicate no template.
mode
Indicates how the sequence number is obtained:
Returned value
The sequence number, or an error status code (see Return Status ).
Example 1
The V code below defines a group object:
group grp1 {
int a;
int &b => grp0.b;
};
You can determine the highest sequence number among grp1, any of its subobjects, and any objects along subobject b's chain of references:
OMobj_id grp1_id;
int seq;
...
seq = OMget_obj_seq(grp1_id, OMnull_obj, OM_SEQ_VAL);
Example 2
This example illustrates the use of template_id .
The V code below defines two groups:
group g1 {
int a, b;
};
g1 g2 {
int c, d;
};
Group g2 has four subobjects: c, d, and the two objects it inherited from g1, a, and b.
The following code segment determines the largest sequence number among group g2and its subobjects, but only considers subobjects a and b:
OMobj_id g1_id, g2_id;
int seq;
...
seq = OMget_obj_seq(g2_id, g1_id, OM_SEQ_VAL);