Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GpiDeleteElementsBetweenLabels (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPISEGEDITING
BOOL GpiDeleteElementsBetweenLabels(hps, idFirstLabel, idLastLabel)
HPS hps; /* presentation-space handle */
LONG idFirstLabel; /* label of first element */
LONG idLastLabel; /* label of last element */
The GpiDeleteElementsBetweenLabels function deletes one or more elements
from the currently open segment. The function deletes all elements between
but not including the elements having the labels specified by the
idFirstLabel and idLastLabel parameters, then moves the element pointer to
the element preceding the deleted elements (if any). If either label cannot
be found between the current element-pointer position and the end of the
segment, the function deletes no elements and returns an error value. The
segment containing the element must be open and the drawing mode must be
DM_RETAIN.
GpiDeleteElementBetweenLabels cannot be used in an element bracket.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
idFirstLabel Specifies the label that marks the start of the elements to
delete.
idLastLabel Specifies the label that marks the end of the elements to
delete.
Return Value
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_INV_HPS
PMERR_INV_IN_ELEMENT
PMERR_INV_MICROPS_FUNCTION
PMERR_LABEL_NOT_FOUND
PMERR_NO_CURRENT_GRAPHICS_SEG
PMERR_NOT_IN_RETAIN_MODE
PMERR_PS_BUSY
Example
This example uses the GpiDeleteElementsBetweenLabels function to delete the
elements between but not including the elements having the labels 1 and 2:
GpiOpenSegment(hps, 2L); /* open segment #2 */
/* delete elements between 1 and 2 */
GpiDeleteElementsBetweenLabels(hps, 1L, 2L);
GpiCloseSegment(hps); /* close the segment */
See Also
GpiLabel, GpiSetElementPointerAtLabel, WinGetLastError
♦