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

Home » Public Forums » archive » Re: Need help ( structures )
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
Re: Need help ( structures ) [message #5429] Wed, 20 December 1995 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
hegde@news.gsfc.nasa.gov (M Hegde) writes:

> Hi:

> I am coming across the following error when initializing a named structure.
> Any help in this regard is greatly appreciated.

> ************************************************************ *******************
> eg:
> ; named structure creation
> name1 = { file, name:' ', header_size:0, data_type:0, format:0, $
> dim:intarr(3), key:' ' }

> ; case I ( valid )
> name1.dim = [ 10, 20] ; initialized name1.dim() to [ 10, 20, 0 ]

> ; case II ( results in error )
> name2 = { file, name:' ', header_size:0, data_type:0, format:0, $
> dim:[10,20], key:' ' }
> ; results in an error since the member 'dim' expects intarr(3)
> ************************************************************ ******************

> Can anyone help me in making named structures as in case II ?

I'm sure you must realize that

name2 = { file, name:' ', header_size:0, data_type:0, format:0, $
dim:[10,20,0], key:' ' }

is perfectly legal.

If you want the size of the dim array to be variable, then simply use unnamed
structures rather than named ones, e.g.

unnamed = { name:' ', header_size:0, data_type:0, format:0, $
dim:[10,20], key:' ' }

Bill Thompson
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL on Solaris 2.5 (now), Alpha NT (soon)
Next Topic: Need help ( structures )

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

Current Time: Fri Oct 10 13:29:54 PDT 2025

Total time taken to generate the page: 0.14482 seconds