Re: Some special behaviour of ROUTINE_NAMES [message #19141] |
Mon, 28 February 2000 00:00 |
Karsten Rodenacker
Messages: 98 Registered: July 1997
|
Member |
|
|
Craig Markwardt schrieb:
> Karsten Rodenacker <rodena@gsf.de> writes:
>
>> Hallo IDL gurus,
>> did anybody remark the quite special behaviour of that undocumented
>> function ROUTINE_NAMES. Try to read with the idl macro import_image a
>> file beginning with a number. A structure is generated with a variable
>> name starting with a number, which is quite difficult to be accessed.
>> Doesn't that open a lot of new possibilities?
>
> I don't know what possibilities you are talking about :-), but you can
> make funny and illegal structures by yourself too. Amuse your
> friends.
>
> IDL Version 5.2.1 (linux x86). (c) 1999, Research Systems, Inc.
> IDL> foo = create_struct('1',1, '2',2)
> IDL> help, /struct, foo
> ** Structure <817fda4>, 2 tags, length=4, refs=1:
> 1 INT 1
> 2 INT 2
> IDL> print, foo.(0), foo.(1)
> 1 2
>
> But, as you can see, the elements can be accessed by using the
> array-like indexing of structure tags.
That does not meet the point. Show me how to create a variable beginning with
an number (access it). E.G. 1foo=create(...)!
Regards
--
Karsten Rodenacker ()
------------------------------------------------------------ -------------:-)
GSF - Forschungszentrum Institute of Biomathematics and Biometry
D-85758 Oberschleissheim Postfach 11 29
Tel: +49 89 31873401 | FAX: ...3369 | rodena@gsf.de | Karsten@Rodenacker.de
http://www.gsf.de/institute/ibb/Rodenacker/findex.html
|
|
|
Re: Some special behaviour of ROUTINE_NAMES [message #19159 is a reply to message #19141] |
Fri, 25 February 2000 00:00  |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
Craig Markwardt wrote:
> I don't know what possibilities you are talking about :-), but you can
> make funny and illegal structures by yourself too. Amuse your
> friends.
>
> IDL Version 5.2.1 (linux x86). (c) 1999, Research Systems, Inc.
> IDL> foo = create_struct('1',1, '2',2)
> IDL> help, /struct, foo
> ** Structure <817fda4>, 2 tags, length=4, refs=1:
> 1 INT 1
> 2 INT 2
> IDL> print, foo.(0), foo.(1)
> 1 2
>
> But, as you can see, the elements can be accessed by using the
> array-like indexing of structure tags.
Don't make a habit of it, because it's illegal in IDL 5.3:
IDL Version 5.3 (Win32 x86). (c) 1999, Research Systems, Inc.
IDL> foo = create_struct('1',1, '2',2)
% CREATE_STRUCT: Illegal tag name: 1.
% Execution halted at: $MAIN$
The documentation actually states that structure tag names must follow
the same rules as variable names. It just wasn't enforced in
create_struct() prior to IDL 5.3.
Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
|
|
|
Re: Some special behaviour of ROUTINE_NAMES [message #19160 is a reply to message #19159] |
Fri, 25 February 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Karsten Rodenacker <rodena@gsf.de> writes:
> Hallo IDL gurus,
> did anybody remark the quite special behaviour of that undocumented
> function ROUTINE_NAMES. Try to read with the idl macro import_image a
> file beginning with a number. A structure is generated with a variable
> name starting with a number, which is quite difficult to be accessed.
> Doesn't that open a lot of new possibilities?
I don't know what possibilities you are talking about :-), but you can
make funny and illegal structures by yourself too. Amuse your
friends.
IDL Version 5.2.1 (linux x86). (c) 1999, Research Systems, Inc.
IDL> foo = create_struct('1',1, '2',2)
IDL> help, /struct, foo
** Structure <817fda4>, 2 tags, length=4, refs=1:
1 INT 1
2 INT 2
IDL> print, foo.(0), foo.(1)
1 2
But, as you can see, the elements can be accessed by using the
array-like indexing of structure tags.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|