[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Including files
- Subject: Re: Including files
- From: Craig Markwardt <craigmnet(at)cow.physics.wisc.edu>
- Date: 24 May 1999 10:39:21 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: U. Wisc. Madison Physics -- Compact Objects
- References: <7ibpsf$362$1@nntp.ucs.ubc.ca>
- Reply-To: craigmnet(at)cow.physics.wisc.edu
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:14882
nilsj@unixg.ubc.ca (Nils Johnson) writes:
>
> The IDL documentation mentions include files, which allows "statements
> contained in an include file" to be "textually inserted into the including
> file."
>
> However, I can not find any mention or examples of how, exactly, to
> include other files. What is the syntax? Are there any examples in the
> documentation or sample code that comes with IDL?
It is not particularly good programming style to do this, and hence I
use it all the time! :-)
Here is you you do it:
pro mypro, arg1, arg2
arg1 = arg2 + 5
... etc
@myinclude.pro
return
end
Note that the standard path is consulted in including myinclude.pro,
otherwise it should be in your current directory. Text is included
from the file verbatim. In the example above, @myinclude.pro appears
within a procedure. Therefore, myinclude.pro should contain neither a
PRO or FUNCTION declaration, nor a final END statement. Works the
same as a C #include directive.
Happy programming,
Craig
--
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@astrog.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------