Beginer question about the @ usage [message #44850] |
Wed, 27 July 2005 10:32  |
Mathieu Malaterre
Messages: 32 Registered: July 2005
|
Member |
|
|
Hello,
So I am slowly learning idl, and I am confused on the use of the '@' to
include files.
If I have:
::::::::::::::
hello.pro
::::::::::::::
print, 'Hello World'
exit
I can just run
$ idl hello.pro
and everything is fine
If I have then:
::::::::::::::
lib.pro
::::::::::::::
; Lib containing one Function
; carre return the square of its input
Function carre, input
return, input*input
End
::::::::::::::
testlib.pro
::::::::::::::
; include the content of file: lib.pro
@lib
a = 5
print, a
b = carre(a)
print, b
exit
I cannot run :
$ idl testlib.pro
it returns:
% Programs can't be compiled from single statement mode.
Then I tried:
$ echo testlib | idl
but then it returns:
% Attempt to call undefined procedure/function: 'TESTLIB'.
% Execution halted at: $MAIN$
What is the correct way to run testlib.pro ?
Thanks
Mathieu
|
|
|