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

Home » Public Forums » archive » Re: Two Questions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Two Questions [message #4819 is a reply to message #4815] Wed, 09 August 1995 00:00 Go to previous messageGo to previous message
offenbrg is currently offline  offenbrg
Messages: 31
Registered: August 1993
Member
mbrown@olie.wvitcoe.wvnet.edu (Myron Brown) writes:

> Hi. I have two questions (that were not answered in the FAQ):


> 1. How do I declare global variables in IDL. I am used to writing in C
> and other such languages. Am I missing something, or shoul

> 2. How do I write programs in IDL using entities similar to C header
> files? I'd like to do things with some structure (not everyth

OK -
You will find that IDL is very unlike C in many respects. However,
these two things you are asking for can be "faked," if you wish:

1. Global variables do not exist. However, "Common blocks" can be used to
achieve the same effect. (A "common block" is a group of variables which
are declared in each function/procedure, but retain their values when out of
scope, and can be declared in as many functions/procedures as you wish).

2. There aren't C header files in IDL. However, a named structure (once
defined) can not be changed at all, so you only have to define it once.
It is possible to write a simple routine which defines your structures, like

pro define_struc
;
common STRUCTURES, x, y
x = {STRUCT1, RA:0.0, DEC:0.0, EPOCH:0.0, FLUX:0.0}
y = {STRUCT2, ON:"", OFF:0L, THIS:fltarr(10), THAT:""}
end

pro use_struct
;
common STRUCTURES, x,y
define_struc
help,x,y
end

...This would define the structures and create variables X and Y which can
be used as "prototype" versions of the structures, etc.

Good Luck!
Joel
--
"...And I am unanimous in this" - Mrs. Slocumbe
------------------------------------------------------------ ----------
| Joel D Offenberg | offenbrg@fondue.gsfc.nasa.gov |
| Hughes STX, NASA/GSFC/LASP | I get paid to stare into space. |
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: overlaying sat image on base map??
Next Topic: No forward_pro statement !!!!

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

Current Time: Thu Oct 09 21:18:05 PDT 2025

Total time taken to generate the page: 0.72091 seconds