comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » deleting structure element
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
deleting structure element [message #20857] Thu, 27 July 2000 00:00 Go to next message
Bernard Puc is currently offline  Bernard Puc
Messages: 65
Registered: January 1998
Member
Is there a neat, clever way to "delete" an element from a structure?
Thanks
--
-Bernard Puc
AETC,INC. (http://www.aetc.com)
1225 Jefferson Davis Hwy, Suite 800
Arlington, VA 22202
(703) 413-0500
Re: deleting structure element [message #20936 is a reply to message #20857] Tue, 01 August 2000 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Yes, it is

look at

delete_tag : This functions deletes a tag in a structure, even
within substructures. There is no problem deleting a tag from a
subsubsub
structure.

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/delete_tag.tar.gz

or

http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/delete_tag.sav

also available:

add_tag : This functions adds a tag on an arbitrary level of a
structure.


replace_tagvalue: This functions replaces a tag in a structure or
sub structure


Reimar Bauer

; EXAMPLE:
; d = {A: 1, B: {B1: 0, B2: 1}, C: {B1: 0, B2: 1}}
;
; result = delete_tag(d, 'B')
; help, result, /str
; ** Structure <1342678>, 2 tags, length=8, refs=1:
; A INT 1
; C STRUCT -> <Anonymous> Array[1]
;
; result = delete_tag(d, ['B*'], SUB = 'C')
; help, result, /str
; ** Structure <13694a8>, 2 tags, length=6, refs=1:
; A INT 1
; B STRUCT -> <Anonymous> Array[1]
;
; result = delete_tag(d, '*B1', SUB = ['B', 'C'])
; help, result.b, /str
; ** Structure <1331be8>, 1 tags, length=2, refs=1:
; B2 INT 1
;
; result = delete_tag(d, ['B1', 'B2'], /ALL)
; help, result, /str
; ** Structure <170fac8>, 1 tags, length=2, refs=1:
; A INT 1
;
; help,(delete_tag(d,'b1',sub_structure='B')).b,/str
; B2 INT 1
;
; help,(delete_tag(d,'b1',sub_structure='B')).c,/str
; ** Structure <1333618>, 2 tags, length=4, refs=1:
; B1 INT 0
; B2 INT 1
;
; help,(delete_tag(d,'*',sub_structure='B')),/str
; ** Structure <133b2d8>, 2 tags, length=6, refs=1:
; A INT 1
; C STRUCT -> <Anonymous> Array[1]
;
; help,(delete_tag(d,'*',sub_structure='B',/sort)),/str
; ** Structure <d40daa8>, 2 tags, length=6, refs=1:
; A INT 1
; C STRUCT -> <Anonymous> Array[1]
;
; help,(delete_tag(d,sub_structure=['B','A'])),/str
; ** Structure <132fe78>, 2 tags, length=6, refs=1:
; A INT 1
; C STRUCT -> <Anonymous> Array[1]
;
; help,(delete_tag(d,sub_structure=['B','C'])),/str
; ** Structure <1333288>, 1 tags, length=2, refs=1:
; A INT 1
;
; help,(delete_tag(d,['B1','B2'],sub_structure=['B','C'])),/st r
; ** Structure <46a9498>, 1 tags, length=2, refs=1:
; A INT 1
;
; d = {ABRA: {B1: 0, B2: 1}, ABRA2B: {B1: 0, B2: 1}, ABRA3B: {B1: 0,
B2: 1}}
;
; result=delete_tag(d,'abra')
; help,result,/str
; ** Structure <1365a48>, 2 tags, length=8, refs=1:
; ABRA2B STRUCT -> <Anonymous> Array[1]
; ABRA3B STRUCT -> <Anonymous> Array[1]
;
; result=delete_tag(d,'abra*')
; help,result,/str
; RESULT INT = -1
;
; result=delete_tag(d,'abra?B')
; help,result,/str
;
; ** Structure <1364358>, 1 tags, length=4, refs=1:
; ABRA STRUCT -> <Anonymous> Array[1]
;
; d = {ABRA: {B1: 0, B2: {A:1}}, ABRA2B: {B1: 0, B2: {A:1}}, ABRA3B:
{B1: 0, B2: {A:1}}}
; result=delete_tag(d,'A',sub_structure='abra.b2')
; help,result.abra,/str
; ** Structure <1365c68>, 1 tags, length=2, refs=2:
; B1 INT 0
;
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ����� �������� ���������� � ������
Next Topic: Re: =?iso-8859-1?Q?=EE=CF=D7=D9=C5=20=CE=C5=CD=C5=C3=CB=C9=C5=20=C1=D7=D4=CF=CD=CF=C2=C9=CC=C9=20=D7=20=EF=C4=C5=D3=D3=C5?=

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:37 PDT 2025

Total time taken to generate the page: 0.00618 seconds