DELSTRUCT Procedure
Deletes one or more named structure definitions from memory.
warning | The routines DELSTRUCT, DELCOM, DELPROC, and DELFUNC are provided as convenience routines for PV-WAVE developers. They allow developers to delete or reset certain elements of PV-WAVE's internal memory, which would otherwise require a restart of the PV-WAVE session. They are only used at the $MAIN$ level, i.e., at the WAVE> prompt. Any other use results in session instability and undefined results. |
Usage
DELSTRUCT, {structure1} ,..., {structuren}
Input Parameters
structurei — The name of the structure definition to be deleted. The name can be specified as {structure}, "structure", or x, where x is a variable of type structure.
Keywords
All — If nonzero, deletes all named structure definitions not currently being referenced by a variable.
Rename — If present and nonzero, this keyword causes the structure definition to be re-named. DELSTRUCT cannot delete a structure definition if it is currently being used (referenced) by a variable, common block, or other structure definition. If a structure is being used and Rename is given, then the structure definition will be renamed. If the structure is not being used, it will be deleted.
Unnall — If nonzero, deletes all unnamed structure definitions not currently being referenced by a variable.
Discussion
DELSTRUCT is useful if you need to change an existing structure definition and do not wish to re-start your PV-WAVE session. To do this, delete the incorrect definition and then create a new, correct structure definition.
If the structure definition is not currently referenced by any variables, other structure definitions, or common blocks, then the structure is deleted. If any references to structure exist, then, by default, you receive an error message and the structure is not deleted. The Rename keyword overrides this default, and renames the existing structure so that the structure name can be reused. When the Rename keyword is used, the original variables remain valid (continue to reference the renamed structure definition); however, no memory is freed.
Use the STRUCTREF function to determine if a structure is currently referenced by any variables, common blocks, or other structure definitions.
note | You cannot delete structure definitions that are system structure definitions, such as !Axis and !Plot, or any structures that begin with an exclamation mark (!). Therefore, if you want to create a new structure that cannot be deleted, begin its name with an exclamation mark (!). |
Example
; Create a structure.
x = {struct1, a:float(0)}
INFO, x, /full
; PV-WAVE prints:
; ** Structure STRUCT1, 1 tags, 4 length:
; A FLOAT 0.000000
; Delete the variable.
DELVAR, x
; Now delete and recreate the structure,
; changing the data type of x.a.
DELSTRUCT, {struct1}
x = {struct1, a:double(0)}
INFO, x, /full
; PV-WAVE prints:
; ** Structure STRUCT1, 1 tags, 8 length:
; A DOUBLE 0.00000000
See Also
For more information on structures, see the PV‑WAVE Programmer’s Guide.
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.