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

Home » Public Forums » archive » RE: integrating new routines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
RE: integrating new routines [message #14482] Tue, 02 March 1999 00:00
Nando Iavarone is currently offline  Nando Iavarone
Messages: 48
Registered: December 1998
Member
Hi Gerhard,
note the difference between the filename "file_lines.pro"
and the function "file_line" (does an 's' miss??).
If you use a function or a procedure contained in a file having
the same name, and if the file is in a directory included in the path of

IDL, IDL look for it automatically.
Another way is to compile your function
(".compile YOUR_PATH/file_lines") before to use it.

Have a nice day.
Nando

--
Nando Iavarone
Advanced Computer System
via Lazzaro Belli, 23
00040 Frascati - RM
Tel: +39-6-944091 (switchboard)
9440943 (direct)
E-mail:
f.iavarone@acsys.it
iavarone@ba.infn.it
Re: integrating new routines [message #14490 is a reply to message #14482] Mon, 01 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Gerhard (rappold@zedat.fu-berlin.de) writes:

> I'm just digging myself into IDL and want to add routines which I
> download.
>
> I'm working with IDL4.0(win), my original problem (still) is to get the
> size of a tabel to read it into an array. Therefore I download from
> <http://www.dfanning.com/tips/unknown_rows.html> the file
> <file_lines.pro> and put it in my working directory.
>
> If I call the routine (as said in the comment of the routine) with
>
> IDL> test=file_line(file)
>
> I just get the following result
>
> % Variable is undefined: FILE_LINE.
>
> I tried to compile the file and checked for the pathvariable but ... ???
>
> Probably a simple solution - but I don't know where to look

Probably my fault, I got this program from someone else and
didn't test it much when I wrote the article above. As it happens,
the modules in this file (there are three) are incorrectly
arranged. The function TYPE should be the first module in the
file, followed by FILE_SIZE and, finally, FILE_LINE.

If you just try to run the program as shown above it
crashes because it references the TYPE function before
it is compiled, which causes IDL to think it is a variable
and not a function. I've fixed the program on my web page,
but you can fix your own program by explicitly compiling the
file before you run it:

IDL> .Compile file_line
IDL> test = File_Line(file)

If you still have problems, then you need to make sure
you have a columnar data file named in the "file" variable.
You could pick such a file like this:

IDL> file = Pickfile()
IDL> IF file NE '' THEN test = File_Line(file) ELSE $
Print, 'No file selected.'

Finally, if you accidentally call the program (or any
function) like this, without the parentheses:

test = File_Line

Then IDL will think FILE_LINE is a variable and not a function.
To get this notion out of IDL's head, you will have to explicitly
compile the function before you can call it correctly:

IDL> .Compile file_line
IDL> test = File_Line(file)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155

[Note: This follow-up was e-mailed to the cited author.]
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: !!! Happy99.exe is a VIRUS !!!!
Next Topic: Maximum limit on keywords?

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

Current Time: Thu Oct 09 21:15:25 PDT 2025

Total time taken to generate the page: 0.08306 seconds