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

Home » Public Forums » archive » Structure field concatenation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Structure field concatenation [message #21614] Thu, 31 August 2000 08:02 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

I know that this has been a subject of some discussion recently... but
I'm still not on firm footing on the best method of changing the size of
an anonymous structure's fields (i.e. I want to increase or decrease the
size of a field). The code below shows an example of how I do it now:
creating a new structure with the appropriately sized fields. Is there
a better method?

;++++++++++++ START
PRO Concatenate_Str_Fields

D = {A:Indgen(12), B:Indgen(12)} ;define a dummy structure

Help, D, /STR

Tags = Tag_Names(D)

NewD = Create_Struct(Tags[0], [D.(0), Indgen(10)]) ;define the new
structure with amended field

For i = 1, N_ELEMENTS(Tags) -1 Do $ ;for each tag recreate
the structure
NewD = Create_Struct( NewD, Tags[i],[D.(i), Indgen(10)] )

Help, NewD, /STR

END

;--------------------END

Thanks,

Ben

BTW: I don't want to steer the discourse toward a scandalous sidebar
discussion, but... I'm wrestling with this because a shrimp starts out
as a male and then ends up as a female a few years later. I'm working
with a database that has the shrimp broken down into records by sex...
but I need to add new records for aggregate sex (that is the sum of
males, transitionals, females,...) I never thought IDL programming
could be so titillating.

--
Ben Tupper
248 Lower Round Pond Road
POB 106
Bristol, ME 04539

Tel: (207) 563-1048
Email: PemaquidRiver@tidewater.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrROI and normalized coords
Next Topic: Re: taking the widget plunge. help

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

Current Time: Wed Oct 08 13:31:11 PDT 2025

Total time taken to generate the page: 0.00413 seconds