oid_forward
oid_forward (oid)
This function returns the object identifier of the element following the element specified by oid in linear (galley strip) order. This function returns oid_null f oid is the last element in the document.
Examples
The loop shown in the following excerpt from a function lists all elements in the document instance from first to last:
for (o = oid_first(); oid_valid(o); o = oid_forward(o)) {
eval oid_name(o) output=>*
}
The oid_forward function can be written using oid_next and oid_childas follows:
function oid_forward(o1)
{
if (!oid_valid(o1)) { return oid_null();}
local o = oid_child(o1);
if (oid_valid(o)) { return o;}
while (oid_valid(o1)) {
o = oid_next(o1);
if (oid_valid(o)) { return o;}
o1 = oid_parent(o1)
}
return oid_null()
}
Related Topics