Re: @make vs command line for creating .sav files. [message #50258] |
Thu, 21 September 2006 10:53 |
Jean H.
Messages: 472 Registered: July 2006
|
Senior Member |
|
|
>> I'm not sure if this is the correct behaviour or not (one would suspect
>> not since David found a different behaviour on windows).
> Actually, this fails on Windows, too, if I set the problem
> up as described in Matt's first post. :-(
It works here..
{ x86 Win32 Windows Microsoft Windows 6.2 Jun 20 2005 32 64}
I tried with the fake_save.pro in a) a directory already set in my path,
B) in a new directory, setting the path in fake_save (as David did)
Fake_routine.pro is in another folder, defined in the path
>> The pragmatic solution is, I guess, to rebuild your path or manually
>> call your startup file after the .reset_session.
> I've tried running my startup file directly after the .RESET
> and that doesn't help either. Something weird is going on
> here. I can't even set the !PATH and get it to work!
>
> Here is my file fake_save.pro:
>
> .reset_session
> !path = !path + "c:\RSI\DAVID\TEST"
try !path = !path + ";c:\RSI\DAVID\TEST"
> !path = expand_path( !path )
> .compile fake_needs
> resolve_all
>
> And here is the result:
>
> IDL> @fake_save
> Compiled module: FAKE_NEEDS.
> Compiled module: RESOLVE_ALL.
> Attempt to call undefined procedure/function: 'FAKE_ROUTINE'.
do you have a fake_routine.pro file?
Jean
> Error occurred at: RESOLVE_ALL_BODY 288 C:\RSI\IDL62\lib
> \resolve_all.pro
> RESOLVE_ALL 347 C:\RSI\IDL62\lib
> \resolve_all.pro
> $MAIN$
> Execution halted at: $MAIN$
>
> Don't know. :-(
>
> Cheers,
>
> David
|
|
|
Re: @make vs command line for creating .sav files. [message #50259 is a reply to message #50258] |
Thu, 21 September 2006 10:45  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
>
> I've tried running my startup file directly after the .RESET
> and that doesn't help either. Something weird is going on
> here. I can't even set the !PATH and get it to work!
>
> Here is my file fake_save.pro:
>
> .reset_session
> !path = !path + "c:\RSI\DAVID\TEST"
> !path = expand_path( !path )
> .compile fake_needs
> resolve_all
Ah, well, if I didn't have errors in my PATH it would
have worked. (Blush..)
Here is the file that *does* work:
.reset_session
!path = !path + ";C:\RSI\DAVID\TEST"
!path = expand_path( !path )
.compile fake_needs
resolve_all
Forgot that pesky semi-colon before the "C".
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: @make vs command line for creating .sav files. [message #50260 is a reply to message #50259] |
Thu, 21 September 2006 10:33  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Allan Whiteford writes:
>
> I'm not sure if this is the correct behaviour or not (one would suspect
> not since David found a different behaviour on windows).
Actually, this fails on Windows, too, if I set the problem
up as described in Matt's first post. :-(
> The pragmatic solution is, I guess, to rebuild your path or manually
> call your startup file after the .reset_session.
I've tried running my startup file directly after the .RESET
and that doesn't help either. Something weird is going on
here. I can't even set the !PATH and get it to work!
Here is my file fake_save.pro:
.reset_session
!path = !path + "c:\RSI\DAVID\TEST"
!path = expand_path( !path )
.compile fake_needs
resolve_all
And here is the result:
IDL> @fake_save
Compiled module: FAKE_NEEDS.
Compiled module: RESOLVE_ALL.
Attempt to call undefined procedure/function: 'FAKE_ROUTINE'.
Error occurred at: RESOLVE_ALL_BODY 288 C:\RSI\IDL62\lib
\resolve_all.pro
RESOLVE_ALL 347 C:\RSI\IDL62\lib
\resolve_all.pro
$MAIN$
Execution halted at: $MAIN$
Don't know. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: @make vs command line for creating .sav files. [message #50261 is a reply to message #50260] |
Thu, 21 September 2006 10:13  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
Fails for me on IDL 6.2 on Linux, the problem seems to be that the
.reset_session is throwing away the path additions when called via @
If I issue the 3 commands:
if (strmatch(!PATH, '*allan*') eq 0L) then print,'1'
.reset_session
if (strmatch(!PATH, '*allan*') eq 0L) then print,'2'
then nothing gets printed but if I put them in an file and call it via @
then I get '2' printed to the screen (I had something with 'allan' added
to my !path variable).
The root of the problem is that the startup file gets processed straight
after the .reset_session when called from the command line but if a
.reset_session call is inside an @file then it's reprocessed after the
whole @file is finished.
I'm not sure if this is the correct behaviour or not (one would suspect
not since David found a different behaviour on windows).
The pragmatic solution is, I guess, to rebuild your path or manually
call your startup file after the .reset_session.
Hope this helps.
Thanks,
Allan
David Fanning wrote:
> savoie@nsidc.org writes:
>
>
>> O.k. I've searched google but I'm not finding the answer.
>>
>> First I'm wondering why and @file on the command line acts differently
>> from typing the commands in one at a time.
>
>
> Humm. Well, it works both ways with IDL 6.2 on Windows.
> If I had to guess, I would say your path is not getting
> set properly after the .reset when running from the @ sign.
> You might try printing !PATH before the call to RESOLVE_ALL
> to see if that is the case.
>
> Cheers,
>
> David
|
|
|
Re: @make vs command line for creating .sav files. [message #50262 is a reply to message #50261] |
Thu, 21 September 2006 09:50  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
savoie@nsidc.org writes:
> O.k. I've searched google but I'm not finding the answer.
>
> First I'm wondering why and @file on the command line acts differently
> from typing the commands in one at a time.
Humm. Well, it works both ways with IDL 6.2 on Windows.
If I had to guess, I would say your path is not getting
set properly after the .reset when running from the @ sign.
You might try printing !PATH before the call to RESOLVE_ALL
to see if that is the case.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|