X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 May 2013 04:49 AM by  anon
"syntax error" on any function that has a keyword
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 May 2013 04:49 AM
    This is a very strange issue. It's happening on my linux IDL 8.2.2, but it is also happening on the old linux IDL 7.0. I was trying to split a string and got this: IDL> a = strsplit("hi, my name is po", /extract) a = strsplit("hi, my name is po", /extract) ^ % Syntax error. I thought it was strange, and I must have done something wrong, so I checked in the online help browser and, sure enough... it's well written. Just to be sure, I copied from the help page and ran it again: IDL> Str = 'STRSPLIT chops up strings.' IDL> print, STRJOIN(STRSPLIT(Str, /EXTRACT), '-') print, STRJOIN(STRSPLIT(Str, /EXTRACT), '-') ^ % Syntax error. Proceeding with the strangeness, I then tried some non-existent function and, sure enough, got exactly the same result! a = anyFunction(input, /keyword) a = anyFunction(input, /keyword) ^ % Syntax error. The ^ symbol is always pointing at the keyword, as if IDL isn't understanding it, or something... I used to have IDL 7.0 and 8.2.2 side by side, but since this came up, I removed both, installed only 8.2.2, but I still get the same thing. I'm at a loss and decided to switch to python for my immediate needs, but I'd like to fix this, if possible. When I don't use a keyword, everything works fine. plot,dindgen(100) is my standard test and that goes through well enough. Running fedora core 18, 32 bits, on a Pentium 4@ 3GHz, if it's relevant... Please help!

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 May 2013 06:52 AM
    My guess is you have somehow managed to remove the standard IDL "library" (/user/local/excelis/idl82/lib) directory from your IDL path. This is exactly the kind of error you would expect if IDL can't find the source code for the program. You can test my theory by typing a command like this: data = dist(200) data = congrid(data, 400, 400) If I'm right, you should get an error on the Congrid command, too. The solution would be to get this library directory back on your IDL path.

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 May 2013 08:27 AM
    The famous dfanning is replying to me! O.O I've been using your libraries for quite a while... and the q&a from your site! :) Thanks a million for all the help you've provided over the years! Unfortunately, my current predicament must be somewhat deeper. I have that lib folder: /usr/local/exelis/idl82/lib, and it has the congrid.pro file in there, as well as many others. But the first line you asked me to run gave this on a freshly started IDL session: IDL> data = dist(200) % Variable is undefined: DIST. % Execution halted at: $MAIN$ hmmm... dist.pro is also in that lib folder.... hmmm.... Could it be because I have the actual installation in a different partition and the /usr/local/exelis is a link to /mnt/data/utils/idl/exelis? The installer created that link automatically, so I'd guess that it should work fine. hmmmm Well, you were right!! The IDL_PATH environment variable didn't have the path to the library in it. I forced it in my .bashrc.... Shouldn't this be done somewhere else? I'll look into it! Thanks again!! :)

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 May 2013 10:35 AM
    Yeah, after I posted I thought, duh, the DIST function will cause a problem if my theory is correct! And, now, I'm certain it is correct. You just don't have this directory and its sub-directories on your IDL path. There are various ways to do it, but if you are doing it from a .bash file, you need to make sure you are defining the environment variable IDL_PATH correctly. Be sure to exit IDL and maybe log out and back in after you make a change.

    Deleted User



    New Member


    Posts:
    New Member


    --
    14 May 2013 02:41 PM
    yep, it was that. I'm sorry I didn't make it clear on the other post. I ended up putting the export command in a file inside /etc/profile.d/ I called it idlpath.sh and added idl70 path in there as well: export IDL_PATH=/mnt/data/utils/idl/itt/idl70/lib/:/mnt/data/utils/idl/exelis/idl82/lib/ Works well for both of them, at the moment. With this, I lost the ability to use idlde70, due to some problem in the jdlm library. I once solved this by installing idl8.2 after installing idl 7.0... that means, there must be some other environment variable that is faulty, because idl 8.2 doesn't seem to have the jdml library.
    You are not authorized to post a reply.