gpi12.hlp (Table of Contents; Topic list)
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.
GpiDeleteElementRange (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPISEGEDITING
 
BOOL GpiDeleteElementRange(hps, idFirstElement, idLastElement)
HPS hps;                /* presentation-space handle */
LONG idFirstElement;    /* first element             */
LONG idLastElement;     /* last element              */
 
The GpiDeleteElementRange function deletes one or more elements from the
currently open segment. The function deletes all elements between and
including the elements specified by idFirstElement and idLastElement, then
moves the element pointer to the preceding element (if any). The function
rounds idFirstElement or idLastElement to a valid element-pointer position
if the given position does not point to an element. The segment containing
the element must be open and the drawing mode must be DM_RETAIN.
 
GpiDeleteElementRange cannot be used in an element bracket.
 
Parameter       Description
────────────────────────────────────────────────────────────────────────────
 
hps             Identifies the presentation space.
 
idFirstElement  Specifies the element-pointer position of the first element
                to delete.
 
idLastElement   Specifies the element-pointer position of the last element
                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
the following:
 
     PMERR_INV_HPS
     PMERR_INV_IN_ELEMENT
     PMERR_INV_MICROPS_FUNCTION
     PMERR_NO_CURRENT_GRAPHICS_SEG
     PMERR_NOT_IN_RETAIN_MODE
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiDeleteElementRange function to delete the second
through fifth elements in the previously created segment 2:
 
GpiOpenSegment(hps, 2L);            /* open segment # 2            */
GpiDeleteElementRange(hps, 2L, 5L); /* delete elements 2 through 5 */
GpiCloseSegment(hps);               /* close the segment           */
 
See Also
 
GpiOffsetElementPointer, GpiQueryElementPointer, GpiSetElementPointer,
WinGetLastError