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

Home » Public Forums » archive » Running DOS-based programs from IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Running DOS-based programs from IDL [message #40683] Tue, 24 August 2004 15:49
i-kant is currently offline  i-kant
Messages: 14
Registered: June 2004
Junior Member
I need to run a dos-based program with extension .EXE

It is a program that was made in the programming language TurboPascal.
Previously, when I needed to open up a windows-based program, I would
just write:

Line (1):
SPAWN, 'c:\Folder\Program.exe'

or

Line (2):
SPAWN, 'start c:\Folder\Program.exe'

Now when I try Line (1) for this TurboPascal-based program, I get the
error at command prompt:

"Runtime error 002 at 0000:0937."

If I try Line (2), a new DOS window opens up for a fleeting moment,
then closes. I know that the program was not run correctly or not run
at all, because the program is supposed to output a data file, which
it did not.

To troubleshoot this problem, I have tried opening up a command prompt
window myself. Then typing in either line (1) or line (2) manually
without the SPAWN procedure obviously. Both did not work.

Then I tried to go to the directory of the program by first using
"cd\" to return to the c:\ prompt, then "cd folder" to move to the
folder in which the program resides, then typing "program.exe". This
time it worked. It appears that I need to be in the folder of that
program before running it.

So it is possible to do it manually, but my problem is how to get IDL
to do this. To use IDL to move to the program's directory and run the
program, it would take three SPAWN procedures in my opinion:

SPAWN, "cd\"
SPAWN, "cd c:\folder\"
SPAWN, "program.exe"

Obviously, running three SPAWN procedures consecutively doesn't work
since once the first one finishes, the next SPAWN procedure will start
up with the default directory again, which in my case is C:\documents
and settings\edwin\ and not the desired c:\folder\.

I'm thinking maybe there is some other procedure in IDL to run
DOS-based exe files, or maybe there is someway to change the default
starting directory from that c:\documents and settings\edwin\ to
c:\folder\. Then I could just do one SPAWN command, SPAWN
"program.exe" and then it should work.


Thanks for any help!


Sincerely,
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Bug with object graphics, app_scroll and the mouse in 6.1 under Windows.
Next Topic: Re: Max X-window width under OS X/X11

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

Current Time: Wed Oct 08 13:43:20 PDT 2025

Total time taken to generate the page: 0.00569 seconds