BB___DELSEGMENT

=DELSEGMENT= toc

Description
> In graphics windows and graphicboxes, deletes a graphics segment and frees the memory it occupies.

> Some additional commands used with the display of graphics: >> segment >> cls >> redraw >> discard >> flush

Syntax
> //This command is NOT case sensitive//. Deleting a segment by number: Deleting a segment by its variable name if name is set with : Deleting a segment by its named ID number if name is set with :
 * 1)  - a graphics window
 * 2)  - a graphicbox

Hints

 * //**Deleting.**// Deleting a segment removes it from the list of graphics items that are redrawn whenever a command is issued.

Example
An example of deleting a segment by its named ID number. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Delsegment Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down and place it   #g "down; place 200 130" 'draw a green circle #g "color green; circle 50" 'save work so far #g "segment circle" #g "flush"

'change color and draw a box #g "color red; size 2; place 140 70" #g "box 260 190" 'save the box #g "segment box" #g "flush"

confirm "Do you want to remove the circle?"; yn$ if yn$="yes" then #g "delsegment "; circle '<--- segment ID name is outside command string #g "redraw" end if   #g "flush" wait

[quit] close #g end code

An example of deleting a segment by its name. code format="lb" nomainwin

WindowWidth=400 WindowHeight=300

open "Delsegment Demo" for graphics_nsb_nf as #g #g "trapclose [quit]"

'put the pen down and place it   #g "down; place 200 130" 'draw a green circle #g "color green; circle 50" 'save work so far #g "flush circle"

'change color and draw a box #g "color red; size 2; place 140 70" #g "box 260 190" 'save the box #g "flush box"

confirm "Do you want to remove the circle?"; yn$ if yn$="yes" then #g "delsegment circle" '<--- segment name is inside command string #g "redraw" end if   #g "flush" wait

[quit] close #g end code

Useful Functions
code format="lb" Place a useful function using this keyword here code