Function GraSegDestroy() Foundation
Deletes a specific graphic segment.
GraSegDestroy( [<oPS>], <nSegmentID> ) --> lSuccess
The return value of GraSegDestroy() is .T. (true) when the segment was deleted, otherwise it is .F. (false). If the return value equals .F., the cause of error can be determined by GraError().
A graphic segment is deleted by GraSegDestroy(). This is always recommended when a segment contains extensive calls of graphic primitives and has been displayed. After display, the segment should be deleted if it is not needed again.
// The example demonstrates how a path is defined
// within a segment. The path needs to be defined only
// once and can then be recreated by GraSegDraw().
// The segment is released after the path operations
// have been executed.
#include "Gra.ch"
PROCEDURE Main
LOCAL nSegment, aAttr, nDrawMode
SetColor("N/W") // fill window with pale gray
CLS
aAttr := Array( GRA_AA_COUNT ) // set fill attributes
aAttr [ GRA_AA_SYMBOL ] := GRA_SYM_DIAG3
GraSetAttrArea( NIL, aAttr )
// set draw mode
nDrawMode:= GraSegDrawMode( NIL, GRA_DM_DRAWANDRETAIN)
nSegment := GraSegOpen()
GraPathBegin() // define graphic path
GraArc( , {150,200}, 50 )
GraArc( , {150,200}, 100 )
GraPathEnd()
GraSegClose()
GraPathFill() // fill path
GraSegDraw( NIL, nSegment ) // recreate path
GraPathOutLine() // outline path
GraSegDestroy( NIL, nSegment ) // release segment
GraSegDrawMode( NIL, nDrawMode ) // reset draw mode
Inkey(0) // wait for key press
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.