accessing structures [message #6478] |
Sat, 29 June 1996 00:00 |
kachun
Messages: 7 Registered: June 1996
|
Junior Member |
|
|
Does anyone know how to access parts of structures in IDL? Looking
up the version of IDL, I can type:
IDL> print,!version
{ sparc sunos 3.6.1}
I can't directly access the individual components, since a help will
give:
IDL> help,!version
<Expression> STRUCT = -> !VERSION Array(1)
Messier is figuring out what the individual components are called,
which will give string outputs:
IDL> print,!version.arch
sparc
IDL> print,!version.os
sunos
IDL> print,!version.release
3.6.1
My question is then how would I pull out what I need to know from
!version if I didn't know the names for the individual components
(i.e., "!version.arch", "!version.os")? Is there a command that
can pull out what I need, like this example below?
IDL> print,MYSTERY_COMMAND(!version,0)
sparc
--
--kachun +** Center for Astrophysics and Space Astronomy **+
+** University of Colorado, Boulder **+
+** Email: kachun@casa.colorado.edu **+
+** http://casa.colorado.edu/~kachun **+
|
|
|