Type define [message #14755] |
Thu, 25 March 1999 00:00  |
VU KHAC Tri
Messages: 25 Registered: March 1999
|
Junior Member |
|
|
Hi,
In C, we can define sth like
#typedef A ....
And in IDL, is this possible ?
Thanks,
Best regards,
Tri.
|
|
|
Re: Type define [message #14816 is a reply to message #14755] |
Fri, 26 March 1999 00:00  |
mallors
Messages: 76 Registered: November 1997
|
Member |
|
|
In article <7defbt$bfh$1@nnrp1.dejanews.com>,
philaldis@geocities.com writes:
> In article <7dd6id$a4m@hermes.fundp.ac.be>,
> "Tri VU KHAC" <tvk@info.fundp.ac.be> wrote:
>> Hi,
>>
>> In C, we can define sth like
>> #typedef A ....
>> And in IDL, is this possible ?
>>
>> Thanks,
>>
>> Best regards,
>> Tri.
>>
>>
> [text cut]
>
> because most of the time your variables are defined by
> what is passed into
> them. You can even call a function like this:
>
> CurrentlyUndefinedVariable = N_Elements([1,2,3])
>
> ....and even though CurrentlyUndefinedVariable had never
> been mentioned anyway
> before in your code, it is now a integer. This is one of
> the great features of
> IDL because it you gives you such flexibiltiy.
Not to be too picky, but N_Elements () will return
CurrentlyUndefinedVariable as a LONG, not an INT.
For someone new to IDL this might cause confusion.
Although most of the time this flexibility is nice, it
can bite you if you are not careful. If it does, it
can produce a bug that can be *very* difficult to
find ... I know from experience ;-)
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
|
|
|