NCL Home > Documentation > Functions > NCL object routines
Destroys objects from NCL.
procedure NhlDestroy ( objects : graphic )
Each element of the objects parameter is destroyed and replaced with the default missing value for NCL objects. Unlike the delete command, NhlDestroy does not delete the variable referencing the objects.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" begin ; ; Create workstation. ; wks = gsn_open_wks("x11","test") ; ; Create a data object. ; npts = 500 x = fspan(0,npts-1,npts) y = 500.+ 0.9 * x * sin(0.031415926535898*x) ; ; Draw XY plot and advance frame. ; xy = gsn_xy(wks,x,y,False) ; ; Clean up. ; NhlDestroy(xy) NhlDestroy(wks) ; ; Note that we can still print these variables, but they will contain ; missing values. ; print(xy) print(wks) end