PDA

View Full Version : Equivalent of BASIC's run?



sean
12-26-2001, 06:12 PM
Is there an equivalent of the run statement in BASIC? It's a statement that will run another program. Will it return to the system afterwards, or will it go back to the program.

DavidP
12-27-2001, 11:20 AM
spawnf()

It is in process.h

It can run DOS or Windows programs.

You can also use system() which accepts dos commands. So if you used system, you would do:

system("cd\windows\myprog.exe");

I use both. spawnf() is the more correct way to run EXE's.

-KEN-
12-27-2001, 11:37 AM
don't you mean

system("c:\\windows\\myprog.exe");

?

:)

sean
01-02-2002, 12:02 PM
Thanks - system() sounds like what I was looking for (even better actually), but do I need to double up on the \'s and all the other escape sequences?

Salem
01-02-2002, 01:43 PM
> but do I need to double up on the \'s and all the other escape sequences?
Yes