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

Home » Public Forums » archive » Running fortran exectuable using IDL spawn fails
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Running fortran exectuable using IDL spawn fails [message #93509 is a reply to message #93508] Tue, 09 August 2016 05:40 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, August 9, 2016 at 2:05:14 PM UTC+2, Susanne wrote:
> I cannot get a simple Fortran code to execute in my Windows 7 command prompt using the IDL 8.5.1 spawn command. I've googled for solutions, and found one that suggested to cd into the path of the exe file. I tried that and it didn't help.
>
> I was able to re-create the result using this very simple Fortran code (test.f):
>
> c This is a test code
> write(*,*) "--- Hello World ---"
> stop
> end
>
> Using "gfortran -o test test.f, I make the executable test.exe without any warnings. When I run the resulting executable manually in my command prompt, I get the expected "Hello World" output in the command prompt. When however, I run test.exe using a spawn command in IDL, after changing into the directory where the .exe resides, ...
>
> cd, path
> spawn, 'test.exe & pause'
>
> ... I only get "Press any key to continue" in the command prompt, but the expected "Hello World" output is missing. Why is the .exe file not running? I've tried simpler spawn commands, e.g., spawn, 'dir & pause', and those produce the expected result. But running the exe file with IDL spawn does not produce the expected output. Hoping that someone can give me a clue what is missing here.

Not sure, but try something like this:

cd, path
spawn, 'test.exe', result, errResult
print, result
print, errResult

what do you get?

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Odd behavior with NaNs
Next Topic: Mapping issue with mapcontinents, /usa and /canada ......

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

Current Time: Fri Oct 10 09:03:22 PDT 2025

Total time taken to generate the page: 1.44012 seconds