Element Pointer

Use the element pointer to change the contents of an existing segment. When calling GpiOpenSegment, the element pointer is set to 0. The first element that you add to a newly created segment causes the pointer to be set to 1, and each subsequent element causes the pointer to be incremented by 1. When a segment is closed, the element pointer is always reset to 0.

Your application can move the element pointer to a specified value using GpiSetElementPointer. For example, to address the sixth element in a segment, set the element pointer to 6.

Your application also can move the element pointer by a specific number, rather than to a specific number, using GpiOffsetElementPointer. For example, if the element pointer currently addresses element 3, to move it to element 8, code an offset of 5 in GpiOffsetElementPointer. The pointer moves backward rather than forward through the segment. The offset value can be a positive or negative number.

If the sum of the offset and the current pointer position is less than 0, the operating system sets the pointer so that it points to position 0. Position 0 precedes the first element in the segment. If the sum of the offset and the current pointer position is greater than the number of elements in the segment, the operating system sets the pointer so that it points to the last element in the segment.

You can determine the current location of the element pointer using GpiQueryElementPointer. To request the contents of a part of or all of the elements at the current pointer position, use GpiQueryElement.


[Back: Element Types]
[Next: Labels]