|
Re: launching executables from idl [message #30005 is a reply to message #30002] |
Wed, 27 March 2002 23:40  |
G Karas
Messages: 12 Registered: March 2002
|
Junior Member |
|
|
or... write off a script from within IDL
save it in a file and use SPAWN with the script name:
eg
file is commands.txt
CMD = 'dothiscommand < commands.txt' ; should work in DOS as well
SPAWN, CMD
or,
CD, dir ; where dir is where your script is
filename = 'commands.script'
CMD = 'chmod 755' + filname ; for unix
SPAWN, CMD
CMD = 'command.script'
SPAWN, CMD, result
print, result ; to get you the results (txt) back in IDL
basically SPAWN is just a way to escape into the
command line from within an IDL session
What I do, is send off all the commands to a script,
then make that executable and SPAWN it. Not very
elegant, very system-dependant, but it is quick and dirty.
cheers!
|
|
|
Re: launching executables from idl [message #30008 is a reply to message #30005] |
Wed, 27 March 2002 17:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jonathan Pearce (jvp10@psu.edu) writes:
> Is it possible to launch executables (*.exe) from IDL? I would like to
> use IDL to write a front end program which would call various
> executables. These executables also need to have command line options
> passed to them.
>
> Can it be done? In the documentation I can only see references to
> calling dlls.
>
> I'd be most grateful for any responses,
Use SPAWN. The command string you send to the OS can have
all kinds of command line arguments, you just won't
be able to pass any IDL variables to your routines.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|