I know I can add children to an object and make them either the first or
last child, but how do I put it in a specific position? The concepts book says:
CCF_REFERENCE
This field consists of the lower 15 bits of the word and is a
positive integer representing the position of the child in its
parent's child list. This number cannot be greater than 32767
(0x7fff hex). If the number given is greater than the number of
current children, the child will be assumed to be last. For
example, a CCF_REFERENCE of five would specify the fourth
child of the parent object, or the last child if there are fewer
than five children currently. When specifying a position for
CCF_REFERENCE, use the CCF_REFERENCE_OFFSET (using
the shift operator).
But I don't understand how 5 would be the fourth child. The other way around
would make sense because then it would be zero based. This would have to be
2 based.
Basically what I want to do is something like this:
optr parent, oldchild, newchild;
word position;
position = @call parent::MSG_GEN_FIND_CHILD(oldchild);
@call parent::MSG_GEN_REMOVE_CHILD(oldchild, 0);
@call parent::MSG_GEN_ADD_CHILD(newchild, position);
I would think that would be how you do it, but the docs have me confused. I
haven't had a chance to try it yet. I probably need to OR a flag in also or
something like that.
------------------------------------------------------------------------
| I've always been afraid to die, but I think I'm more afraid to live. |
| -Billy Corgan, Smashing Pumpkins, The Aeroplane Flys High |
------------------------------------------------------------------------
| Edward Di Geronimo Jr. edwdig@bergen.org |
------------------------------------------------------------------------