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

Home » Public Forums » archive » Re: Help: definition of the structure in COMMON block
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: Help: definition of the structure in COMMON block [message #14808] Sun, 28 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
VU KHAC Tri (tvk@info.fundp.ac.be) writes:

> I want to define a structured variable as global variable. So I think
> about using the COMMON block to share this variable with others
> procedures. However, IDL does not enable to use this variable in a
> procedure without declaration.
>
> pro A
> COMMON SHARE1, X ;how to define x as a structure ?
> X.a = 1
> X.b = 2
> end
>
> pro B
> COMMON SHARE1
> X.a = 4 ; this is not permitted
> X.b = 5
> end
>
>
> Does anyone know how to resolve this problem ?

You need a structure definition statement following the
COMMON declaration:

pro A
COMMON SHARE1, X ;how to define x as a structure ?
x = {A:0, B:0}
;^^^^^^^^^^^^^^^^
X.a = 1
X.b = 2
end

pro B
COMMON SHARE1
X.a = 4 ; this is not permitted
X.b = 5
end

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Time Zones?
Next Topic: Re: REPENT: Jesus is *your* King! � � ` ��

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

Current Time: Fri Oct 10 01:17:49 PDT 2025

Total time taken to generate the page: 0.47863 seconds