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

Home » Public Forums » archive » Re: how can i call a compiled fortran code from IDL?
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: how can i call a compiled fortran code from IDL? [message #33942 is a reply to message #33939] Thu, 06 February 2003 10:02 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
mads wrote:
>
> hi all,
> what if i have to use,
> spawn, 'c:\hi\\something.exe'

what about something like:

execution_string = 'c:\hi\' + execution_directory + '\something.exe'
spawn, execution_string

You have to specify (somehow, e.g. via an argument with a default?) what is the directory
that contains the executable, but you would have to identify it somehow in any case.

E.g.:

Given a utility routine:
FUNCTION Valid_String, Input_String
IF ( N_ELEMENTS( Input_String ) EQ 0 ) THEN RETURN, 0
IF ( STRLEN( Input_String ) EQ 0 ) THEN RETURN, 0
RETURN, 1
END

then:

PRO myidlpro, Execution_Directory = Execution_Directory

Default_ExeDir = 'what_now'
IF ( Valid_String( Execution_Directory ) ) THEN $
ExeDir = Execution_Directory $
ELSE $
ExeDir = Default_ExeDir

....do some other stuff...

Execution_String = 'c:\hi\' + ExeDir + '\something.exe'
SPAWN, Execution_String

...do some more stuff

END

So if you don't specify the "Execution_Directory" optional argument, it will default, but
you can specify an alternative if required.

You should search the IDL online dos for "noninteractive use of spawn".


paulv

> now the space that is in "what now" causes a problem. Thats the reason i was
> against spawning. i can solve that by just moving all the files into the
> working directory and just use
> spawn,'something.exe'
> thats how i have solved the problem now
> sincerely
> madhu

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7274
Fax:(301)763-8545
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postscript output mods
Next Topic: Re: XROI in IDL5.6 on MAC OS 10.2?

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

Current Time: Sun Oct 12 06:44:15 PDT 2025

Total time taken to generate the page: 1.99742 seconds