Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

EXECUTE_COMMAND_LINE

$
0
0
                istat=-99 ! initialise  istat as it might not be assigned and then gives an uninitalised var failure.
                CALL EXECUTE_COMMAND_LINE("fred.exe",WAIT=.true.,EXITSTAT=istat)

And from the help>>>

exitstat

(Inout; optional) Must be a scalar of type integer. If the command is executed synchronously, exitstat is assigned the value of the processor-dependent exit status of the executed command. Otherwise, the value of exitstat is unchanged.

 

If istat is not pre-initialised and if a synchronous command fails to run (e.g. not found) istat is returned uninitialised and a "check uninit" runtime error occurs. I can see a number of different argument on this but the normal expectation of a intrinsic with a return status is for the return status to always be set.

I think a note advising initialisation by be helpful as setting a return status that is unconnected with the command being run might also cause confusion.

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>